Skip to content

Commit

Permalink
chore: lint header
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Dec 19, 2024
1 parent 95c2794 commit ec852b4
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions frontend/shared/browser-tests/page-models/Header.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Selector, t } from 'testcafe';

import TranslationsApi from '../../src/__tests__/types/translations';
import isRealIntegrationsEnabled from '../../src/flags/is-real-integrations-enabled';
import { Language } from '../../src/i18n/i18n';
import User from '../../src/types/user';
import TranslatedComponent, { CommonTranslations } from './TranslatedComponent';

class Header<
Expand All @@ -15,15 +13,10 @@ class Header<
}

private withinNavigationActions = this.within(
// eslint-disable-next-line no-secrets/no-secrets
Selector('div[class*="HeaderActionBar-module_headerActions"]')
);

private getUserInfo(user?: User): string {
return `${
isRealIntegrationsEnabled() ? 'Mika Hietanen' : user?.name ?? ''
}`;
}

private headerTitle(): Selector {
return this.within(this.component.findByRole('banner'))
.findAllByText(this.translations.appName)
Expand All @@ -47,6 +40,7 @@ class Header<
});
}

// eslint-disable-next-line class-methods-use-this
private userInfoDropdown(): Selector {
return Selector('button').withAttribute(
'aria-controls',
Expand All @@ -60,7 +54,7 @@ class Header<
});
}

public userIsLoggedIn(user?: User): Promise<void> {
public userIsLoggedIn(): Promise<void> {
return this.expect(this.userInfoDropdown());
}

Expand All @@ -76,7 +70,7 @@ class Header<
return t.click(this.loginButton());
}

public async clickLogoutButton(user?: User): Promise<void> {
public async clickLogoutButton(): Promise<void> {
return t.click(this.userInfoDropdown()).click(this.logoutButton());
}
}
Expand Down

0 comments on commit ec852b4

Please sign in to comment.