Skip to content

Commit

Permalink
refactor: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Apr 3, 2024
1 parent 16345b7 commit c19eecf
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
8 changes: 4 additions & 4 deletions libs/angular-accelerator/testing/page-header.harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ interface ObjectDetailItemHarnessFilters extends BaseHarnessFilters {
class ObjectDetailItemHarness extends ComponentHarness {
static hostSelector = '.object-info'

getLabelElement = this.locatorFor('[name="object-detail-label"]')
getValueElement = this.locatorForOptional('[name="object-detail-value"]')
getIconElement = this.locatorForOptional('[name="object-detail-icon"]')

static with(options: ObjectDetailItemHarnessFilters): HarnessPredicate<ObjectDetailItemHarness> {
return new HarnessPredicate(ObjectDetailItemHarness, options).addOption('label', options.label, (harness, label) =>
HarnessPredicate.stringMatches(harness.getLabel(), label)
)
}

getLabelElement = this.locatorFor('[name="object-detail-label"]')
getValueElement = this.locatorForOptional('[name="object-detail-value"]')
getIconElement = this.locatorForOptional('[name="object-detail-icon"]')

async getLabel() {
return (await this.getLabelElement()).text()
}
Expand Down
78 changes: 39 additions & 39 deletions libs/angular-accelerator/testing/search-header.harness.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import { ComponentHarness } from '@angular/cdk/testing'
import { PButtonHarness, ButtonHarness } from '@onecx/angular-testing'
import { PButtonHarness } from '@onecx/angular-testing'
import { PageHeaderHarness } from './page-header.harness'
import { SearchConfigHarness } from './search-config.harness'
import { MoreActionsMenuButtonHarness } from './more-actions-menu-button.harness'

export class SearchHeaderHarness extends ComponentHarness {
static hostSelector = 'ocx-search-header'

getPageHeader = this.locatorFor(PageHeaderHarness)
getSearchConfig = this.locatorFor(SearchConfigHarness)
getSearchButton = this.locatorFor(
PButtonHarness.with({
id: 'searchButton',
})
)

getResetButton = this.locatorFor(
PButtonHarness.with({
id: 'resetButton',
})
)

getSimpleAdvancedButton = this.locatorForOptional(
PButtonHarness.with({
id: 'simpleAdvancedButton',
})
)

getMoreActionsMenuButton = this.locatorForOptional(MoreActionsMenuButtonHarness)

async clickResetButton() {
await (await this.getResetButton()).click()
}
static hostSelector = 'ocx-search-header'

async clickSearchButton() {
await (await this.getSearchButton()).click()
}
getPageHeader = this.locatorFor(PageHeaderHarness)
getSearchConfig = this.locatorFor(SearchConfigHarness)
getSearchButton = this.locatorFor(
PButtonHarness.with({
id: 'searchButton',
})
)

getResetButton = this.locatorFor(
PButtonHarness.with({
id: 'resetButton',
})
)

getSimpleAdvancedButton = this.locatorForOptional(
PButtonHarness.with({
id: 'simpleAdvancedButton',
})
)

async toggleSimpleAdvanced() {
if (await this.getSimpleAdvancedButton()) {
await (await this.getSimpleAdvancedButton())?.click()
} else {
console.warn('No SimpleAdvancedButton is being displayed to toggle, because no advanced form field is defined.')
}
}
}
getMoreActionsMenuButton = this.locatorForOptional(MoreActionsMenuButtonHarness)

async clickResetButton() {
await (await this.getResetButton()).click()
}

async clickSearchButton() {
await (await this.getSearchButton()).click()
}

async toggleSimpleAdvanced() {
if (await this.getSimpleAdvancedButton()) {
await (await this.getSimpleAdvancedButton())?.click()
} else {
console.warn('No SimpleAdvancedButton is being displayed to toggle, because no advanced form field is defined.')
}
}
}

0 comments on commit c19eecf

Please sign in to comment.