chore: add linter to tests

This commit is contained in:
Jakub P.
2024-07-18 12:39:04 +02:00
parent 27610c002c
commit 0a1461231b
22 changed files with 66 additions and 33 deletions

View File

@@ -14,6 +14,6 @@ export class DeleteUserModal {
async close () {
await this.page.click('body', {
position: { x: 10, y: 10 }
})
});
}
}

View File

@@ -1,4 +1,4 @@
const { AdminCreateRolePage } = require('./create-role-page')
const { AdminCreateRolePage } = require('./create-role-page');
export class AdminEditRolePage extends AdminCreateRolePage {
constructor (page) {

View File

@@ -23,6 +23,7 @@ export class AdminEditUserPage extends AuthenticatedPage {
*/
async waitForLoad(fullName) {
return await this.page.waitForFunction((fullName) => {
// eslint-disable-next-line no-undef
const el = document.querySelector("[data-test='full-name-input']");
return el && el.value === fullName;
}, fullName);

View File

@@ -25,5 +25,5 @@ export const adminFixtures = {
adminCreateRolePage: async ({ page}, use) => {
await use(new AdminCreateRolePage(page));
},
}
};

View File

@@ -87,6 +87,7 @@ export class AdminUsersPage extends AuthenticatedPage {
await this.firstPageButton.click();
}
// eslint-disable-next-line no-constant-condition
while (true) {
if (await this.usersLoader.isVisible()) {
await this.usersLoader.waitFor({
@@ -108,6 +109,7 @@ export class AdminUsersPage extends AuthenticatedPage {
async getTotalRows() {
return await this.page.evaluate(() => {
// eslint-disable-next-line no-undef
const node = document.querySelector('[data-total-count]');
if (node) {
const count = Number(node.dataset.totalCount);
@@ -121,6 +123,7 @@ export class AdminUsersPage extends AuthenticatedPage {
async getRowsPerPage() {
return await this.page.evaluate(() => {
// eslint-disable-next-line no-undef
const node = document.querySelector('[data-rows-per-page]');
if (node) {
const count = Number(node.dataset.rowsPerPage);