Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dujes8 committed Apr 15, 2024
1 parent c611470 commit a40ac56
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 20 deletions.
3 changes: 1 addition & 2 deletions tests/sanity/tests/contacts.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect, test } from '@playwright/test'
import { fillSearch, generateId, PlatformURI } from './utils'


test.describe('contact tests', () => {
test.beforeEach(async ({ page }) => {
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
Expand Down Expand Up @@ -45,7 +44,7 @@ test.describe('contact tests', () => {
await page.waitForSelector('form.antiCard', { state: 'detached' })
await expect(page.locator(`text=${orgName}`)).toBeVisible()
})

test('contact-search', async ({ page }) => {
await page.locator('[id="app-contact\\:string\\:Contacts"]').click()

Expand Down
1 change: 0 additions & 1 deletion tests/sanity/tests/hr.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Page, test } from '@playwright/test'
import { PlatformURI } from './utils'


export async function createDepartment (page: Page, departmentName: string): Promise<void> {
await page.click('button:has-text("Department")')
const departmentNameField = page.locator('[placeholder="Department"]')
Expand Down
1 change: 0 additions & 1 deletion tests/sanity/tests/login.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { test } from '@playwright/test'
import { PlatformUser } from './utils'
import { LoginPage } from './model/login-page'
import { SelectWorkspacePage } from './model/select-workspace-page'

test.describe('login test', () => {
test('check login', async ({ page }) => {
Expand Down
6 changes: 3 additions & 3 deletions tests/sanity/tests/model/login-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ export class LoginPage {
readonly buttonLogin: Locator
readonly linkSignUp: Locator

constructor(page: Page) {
constructor (page: Page) {
this.page = page
this.inputEmail = page.locator('input[name=email]')
this.inputPassword = page.locator('input[name=current-password]')
this.buttonLogin = page.getByRole('button', { name: 'Log In' })
this.linkSignUp = page.getByRole('link', { name: 'Sign Up' })
}

async visitLoginRoute(): Promise<void> {
async visitLoginRoute (): Promise<void> {
await (await this.page.goto(`${PlatformURI}${LoginPage.loginRoute}`))?.finished()
}

async login(email: string, password: string, path?: string): Promise<void> {
async login (email: string, password: string, path?: string): Promise<void> {
await this.inputEmail.fill(email)
await this.inputPassword.fill(password)
expect(await this.buttonLogin.isEnabled()).toBe(true)
Expand Down
4 changes: 2 additions & 2 deletions tests/sanity/tests/model/signup-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class SignUpPage extends CommonPage {
readonly buttonSignUp: Locator
readonly buttonJoin: Locator

constructor(page: Page) {
constructor (page: Page) {
super()
this.page = page
this.inputFirstName = page.locator('input[name="given-name"]')
Expand All @@ -24,7 +24,7 @@ export class SignUpPage extends CommonPage {
this.buttonJoin = page.locator('button', { hasText: 'Join' })
}

async signUp(data: SignUpData, mode: 'join' | 'signup' = 'signup'): Promise<void> {
async signUp (data: SignUpData, mode: 'join' | 'signup' = 'signup'): Promise<void> {
const { firstName, lastName, email, password } = data

await this.inputFirstName.fill(firstName)
Expand Down
10 changes: 5 additions & 5 deletions tests/sanity/tests/model/spotlight-popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class SpotlightPopup extends CommonPage {
readonly input: Locator
readonly statusbar: StatusBar

constructor(page: Page) {
constructor (page: Page) {
super()
this.page = page
this.popup = page.locator('div.popup')
Expand All @@ -17,26 +17,26 @@ export class SpotlightPopup extends CommonPage {
this.statusbar = new StatusBar(page)
}

async open(): Promise<void> {
async open (): Promise<void> {
if (await this.popup.isVisible()) {
await this.close()
}
await this.statusbar.clickButtonSearch()
await expect(this.popup).toBeVisible()
}

async close(): Promise<void> {
async close (): Promise<void> {
await this.page.keyboard.press('Escape')
await expect(this.popup).not.toBeVisible()
}

async fillSearchInput(search: string): Promise<void> {
async fillSearchInput (search: string): Promise<void> {
await this.input.fill(search)
await expect(this.input).toHaveValue(search)
await this.page.waitForTimeout(500)
}

async checkSearchResult(search: string, count: number): Promise<void> {
async checkSearchResult (search: string, count: number): Promise<void> {
await expect(this.popup.locator('div.list-item', { hasText: search })).toHaveCount(count)
}
}
2 changes: 1 addition & 1 deletion tests/sanity/tests/org.members.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test } from '@playwright/test'
import { generateId, PlatformSetting, PlatformURI } from './utils'
import { generateId, PlatformURI } from './utils'

test.describe('recruit tests', () => {
test.beforeEach(async ({ page }) => {
Expand Down
8 changes: 4 additions & 4 deletions tests/sanity/tests/tracker/layout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {

const getIssueName = (postfix: string = generateId(5)): string => `issue-${postfix}`

async function createIssues(
async function createIssues (
prefix: string,
page: Page,
components?: string[],
Expand Down Expand Up @@ -47,7 +47,7 @@ async function createIssues(
return issuesProps
}

async function createComponents(page: Page): Promise<string[]> {
async function createComponents (page: Page): Promise<string[]> {
const components = []

for (let index = 0; index < 5; index++) {
Expand All @@ -60,7 +60,7 @@ async function createComponents(page: Page): Promise<string[]> {
return components
}

async function createMilestones(page: Page): Promise<string[]> {
async function createMilestones (page: Page): Promise<string[]> {
const milestones = []

for (let index = 0; index < 5; index++) {
Expand All @@ -73,7 +73,7 @@ async function createMilestones(page: Page): Promise<string[]> {
return milestones
}

async function initIssues(prefix: string, page: Page): Promise<IssueProps[]> {
async function initIssues (prefix: string, page: Page): Promise<IssueProps[]> {
const components = await createComponents(page)
const milestones = await createMilestones(page)
const issuesProps = await createIssues(prefix, page, components, milestones)
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/tests/tracker/tracker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.describe('Tracker tests', () => {
await performPanelTest(statuses, pPage[0], pPage[1])
}

async function performPanelTest(statuses: string[], panel: string, mode: string): Promise<void> {
async function performPanelTest (statuses: string[], panel: string, mode: string): Promise<void> {
const excluded = DEFAULT_STATUSES.filter((status) => !statuses.includes(status))
await new TrackerNavigationMenuPage(page).openIssuesForProject('Default')
await page.locator(`.ac-header .overflow-label:has-text("${mode}")`).click()
Expand Down

0 comments on commit a40ac56

Please sign in to comment.