Skip to content

Commit 089b95e

Browse files
committed
ESLint files, and upgrade it to 9.20.1 in pre-commit, add PHP-CS-Fixer
1 parent a9e1ea2 commit 089b95e

File tree

3 files changed

+59
-52
lines changed

3 files changed

+59
-52
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ repos:
2828
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
2929
types: [ file ]
3030
additional_dependencies:
31-
- eslint@9.19.0
31+
- eslint@9.21.0
3232

33-
# - repo: local
34-
# hooks:
35-
# - id: php-cs-fixer
36-
# name: PHP CS Fixer
37-
# # To match value in Makefile
38-
# entry: ghcr.io/php-cs-fixer/php-cs-fixer:3.69-php8.1 fix --config .php-cs-fixer.dist.php --allow-risky=yes
39-
# language: docker_image
33+
- repo: local
34+
hooks:
35+
- id: php-cs-fixer
36+
name: PHP CS Fixer
37+
# To match value in Makefile
38+
entry: ghcr.io/php-cs-fixer/php-cs-fixer:3.69-php8.1 fix --config .php-cs-fixer.dist.php --allow-risky=yes
39+
language: docker_image

eslint.config.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default [
6969
},
7070
rules: {
7171
"@stylistic/js/indent": [
72-
'error', 4, {
72+
"error", 4, {
7373
"SwitchCase": 1,
7474
"ignoredNodes": ["TemplateLiteral *"],
7575
}
@@ -78,7 +78,13 @@ export default [
7878
"error", 290, 4], // It's a temporary value, until we fix some.
7979
"no-prototype-builtins": "off",
8080
"no-undef": "off",
81-
'jsdoc/require-description': 'warn',
81+
"jsdoc/require-description": "warn",
82+
"jsdoc/tag-lines": [
83+
"error"|"warn",
84+
"always",{
85+
"applyToEndTag":false
86+
}
87+
],
8288
},
8389
}, {
8490
files: [

tests/end2end/playwright/header.spec.js

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,51 @@ test.describe('Header',
88
},
99
() => {
1010

11-
test('Login info as user A on the landing page', async ({ browser }) => {
12-
const userA = await browser.newContext({ storageState: 'playwright/.auth/user_in_group_a.json' });
13-
const page = await userA.newPage();
14-
await page.goto('index.php');
11+
test('Login info as user A on the landing page', async ({ browser }) => {
12+
const userA = await browser.newContext({ storageState: 'playwright/.auth/user_in_group_a.json' });
13+
const page = await userA.newPage();
14+
await page.goto('index.php');
1515

16-
// Fixme, class "hide" but visible ?
17-
await expect(page.locator("#info-user-login")).toHaveText("user_in_group_a");
18-
await expect(page.locator("#info-user-firstname")).toHaveText("User A");
19-
await expect(page.locator("#info-user-firstname")).toHaveClass("hide");
20-
await expect(page.locator("#info-user-firstname")).toBeVisible();
21-
await expect(page.locator("#info-user-lastname")).toHaveText("Testadiferro");
22-
await expect(page.locator("#info-user-lastname")).toHaveClass("hide");
23-
await expect(page.locator("#info-user-lastname")).toBeVisible();
24-
await expect(page.locator("#info-user-organization")).toHaveText("Make it KISS");
25-
await expect(page.locator("#info-user-organization")).toHaveClass("hide");
26-
await expect(page.locator("#info-user-organization")).toBeVisible();
27-
});
16+
// Fixme, class "hide" but visible ?
17+
await expect(page.locator("#info-user-login")).toHaveText("user_in_group_a");
18+
await expect(page.locator("#info-user-firstname")).toHaveText("User A");
19+
await expect(page.locator("#info-user-firstname")).toHaveClass("hide");
20+
await expect(page.locator("#info-user-firstname")).toBeVisible();
21+
await expect(page.locator("#info-user-lastname")).toHaveText("Testadiferro");
22+
await expect(page.locator("#info-user-lastname")).toHaveClass("hide");
23+
await expect(page.locator("#info-user-lastname")).toBeVisible();
24+
await expect(page.locator("#info-user-organization")).toHaveText("Make it KISS");
25+
await expect(page.locator("#info-user-organization")).toHaveClass("hide");
26+
await expect(page.locator("#info-user-organization")).toBeVisible();
27+
});
2828

29-
test('Login info as user A on project page', async ({ browser }) => {
30-
const userA = await browser.newContext({ storageState: 'playwright/.auth/user_in_group_a.json' });
31-
const userPage = await userA.newPage();
32-
const projectPage = new ProjectPage(userPage, 'world-3857');
33-
await projectPage.open();
29+
test('Login info as user A on project page', async ({ browser }) => {
30+
const userA = await browser.newContext({ storageState: 'playwright/.auth/user_in_group_a.json' });
31+
const userPage = await userA.newPage();
32+
const projectPage = new ProjectPage(userPage, 'world-3857');
33+
await projectPage.open();
3434

35-
await expect(userPage.locator("#info-user-login")).toHaveText("user_in_group_a");
36-
await expect(userPage.locator("#info-user-firstname")).toHaveText("User A");
37-
await expect(userPage.locator("#info-user-firstname")).toHaveClass("hide");
38-
await expect(userPage.locator("#info-user-firstname")).not.toBeVisible();
39-
await expect(userPage.locator("#info-user-lastname")).toHaveText("Testadiferro");
40-
await expect(userPage.locator("#info-user-lastname")).toHaveClass("hide");
41-
await expect(userPage.locator("#info-user-lastname")).not.toBeVisible();
42-
await expect(userPage.locator("#info-user-organization")).toHaveText("Make it KISS");
43-
await expect(userPage.locator("#info-user-organization")).toHaveClass("hide");
44-
await expect(userPage.locator("#info-user-organization")).not.toBeVisible();
45-
});
35+
await expect(userPage.locator("#info-user-login")).toHaveText("user_in_group_a");
36+
await expect(userPage.locator("#info-user-firstname")).toHaveText("User A");
37+
await expect(userPage.locator("#info-user-firstname")).toHaveClass("hide");
38+
await expect(userPage.locator("#info-user-firstname")).not.toBeVisible();
39+
await expect(userPage.locator("#info-user-lastname")).toHaveText("Testadiferro");
40+
await expect(userPage.locator("#info-user-lastname")).toHaveClass("hide");
41+
await expect(userPage.locator("#info-user-lastname")).not.toBeVisible();
42+
await expect(userPage.locator("#info-user-organization")).toHaveText("Make it KISS");
43+
await expect(userPage.locator("#info-user-organization")).toHaveClass("hide");
44+
await expect(userPage.locator("#info-user-organization")).not.toBeVisible();
45+
});
4646

47-
test('Login info as anonymous on the landing page', async ({ page }) => {
48-
await page.goto('index.php');
49-
await expect(page.locator("#headermenu .login")).toHaveText("Connect");
50-
});
47+
test('Login info as anonymous on the landing page', async ({ page }) => {
48+
await page.goto('index.php');
49+
await expect(page.locator("#headermenu .login")).toHaveText("Connect");
50+
});
5151

52-
test('Login info as anonymous on project page', async ({ page }) => {
53-
const projectPage = new ProjectPage(page, 'world-3857');
54-
await projectPage.open();
55-
await expect(page.locator("#headermenu .login")).toHaveText("Connect");
56-
});
57-
});
52+
test('Login info as anonymous on project page', async ({ page }) => {
53+
const projectPage = new ProjectPage(page, 'world-3857');
54+
await projectPage.open();
55+
await expect(page.locator("#headermenu .login")).toHaveText("Connect");
56+
});
57+
}
58+
);

0 commit comments

Comments
 (0)