Skip to content

Commit

Permalink
refactor: 💡 Fix linting errors in e2e (#2563)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedLi authored Nov 14, 2024
1 parent 7e56e1c commit 6e71712
Show file tree
Hide file tree
Showing 8 changed files with 627 additions and 59 deletions.
3 changes: 0 additions & 3 deletions e2e-tests/admin/tests/credential-store-vault-ent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
*/

import { test } from '../playwright.config.js';
import { expect } from '@playwright/test';
import { execSync } from 'child_process';
import { nanoid } from 'nanoid';
import { readFile } from 'fs/promises';

import { authenticatedState } from '../global-setup.js';
import {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/admin/tests/credential-store-vault.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({
const keyData = await readFile(sshKeyPath, {
encoding: 'utf-8',
});
if (keyData != retrievedKey) {
if (keyData !== retrievedKey) {
throw new Error('Stored Key does not match');
}
} finally {
Expand Down
1 change: 0 additions & 1 deletion e2e-tests/admin/tests/group-role.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import { test } from '../playwright.config.js';
import { expect } from '@playwright/test';

import { authenticatedState } from '../global-setup.js';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import { test } from '../playwright.config.js';
import { expect } from '@playwright/test';
import { execSync } from 'child_process';

import { authenticatedState } from '../global-setup.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import { test } from '../playwright.config.js';
import { expect } from '@playwright/test';
import { execSync } from 'child_process';

import { authenticatedState } from '../global-setup.js';
Expand Down
17 changes: 4 additions & 13 deletions e2e-tests/admin/tests/worker-tags.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ test('Worker Tags @ce @ent @aws @docker', async ({ page }) => {
.getByRole('columnheader')
.nth(i)
.innerText();
if (header == 'Worker') {
if (header === 'Worker') {
workerListWorkerIndex = i;
} else if (header == 'Tags') {
} else if (header === 'Tags') {
workerListTagIndex = i;
}
}
Expand All @@ -58,7 +58,6 @@ test('Worker Tags @ce @ent @aws @docker', async ({ page }) => {
.getByRole('table')
.getByRole('columnheader')
.count();
let dialogTagIndex;
let dialogTypeIndex;
for (let i = 0; i < dialogHeadersCount; i++) {
const header = await page
Expand All @@ -67,9 +66,7 @@ test('Worker Tags @ce @ent @aws @docker', async ({ page }) => {
.getByRole('columnheader')
.nth(i)
.innerText();
if (header == 'Tag') {
dialogTagIndex = i;
} else if (header == 'Type') {
if (header === 'Type') {
dialogTypeIndex = i;
}
}
Expand Down Expand Up @@ -142,20 +139,14 @@ test('Worker Tags @ce @ent @aws @docker', async ({ page }) => {
.getByRole('table')
.getByRole('columnheader')
.count();
let workerDetailsKeyIndex;
let workerDetailsValueIndex;
let workerDetailsTypeIndex;
for (let i = 0; i < workerDetailsHeadersCount; i++) {
const header = await page
.getByRole('table')
.getByRole('columnheader')
.nth(i)
.innerText();
if (header == 'Key') {
workerDetailsKeyIndex = i;
} else if (header == 'Value') {
workerDetailsValueIndex = i;
} else if (header == 'Type') {
if (header === 'Type') {
workerDetailsTypeIndex = i;
}
}
Expand Down
3 changes: 2 additions & 1 deletion e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
"admin:dev:firefox": "yarn run admin --project=firefox --headed",
"admin:dev:safari": "yarn run admin --project=webkit --headed",
"desktop": "yarn workspace desktop build && yarn run desktop:dev",
"desktop:dev": "npx playwright test --config desktop/playwright.config.js --reporter=html"
"desktop:dev": "yarn playwright test --config desktop/playwright.config.js --reporter=html"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.21.3",
"@playwright/test": "^1.43.0",
"concurrently": "^9.1.0",
"dotenv": "^16.4.5",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-n": "^16.3.1",
Expand Down
Loading

0 comments on commit 6e71712

Please sign in to comment.