Browse Source

chore(playwright): rename primary value to display value

pull/5117/head
Wing-Kam Wong 2 years ago
parent
commit
f806ed93f5
  1. 10
      tests/playwright/pages/Dashboard/Grid/Column/index.ts
  2. 4
      tests/playwright/tests/columnMenuOperations.spec.ts

10
tests/playwright/pages/Dashboard/Grid/Column/index.ts

@ -44,7 +44,7 @@ export class ColumnPageObject extends BasePage {
timeFormat = '',
insertAfterColumnTitle,
insertBeforeColumnTitle,
isPrimaryValue = false,
isDisplayValue = false,
}: {
title: string;
type?: string;
@ -61,12 +61,12 @@ export class ColumnPageObject extends BasePage {
timeFormat?: string;
insertBeforeColumnTitle?: string;
insertAfterColumnTitle?: string;
isPrimaryValue?: boolean;
isDisplayValue?: boolean;
}) {
if (insertBeforeColumnTitle) {
await this.grid.get().locator(`th[data-title="${insertBeforeColumnTitle}"] .nc-ui-dt-dropdown`).click();
if (isPrimaryValue) {
if (isDisplayValue) {
await expect(this.rootPage.locator('li[role="menuitem"]:has-text("Insert Before")')).toHaveCount(0);
return;
}
@ -321,10 +321,10 @@ export class ColumnPageObject extends BasePage {
await this.grid.get().locator(`th[data-title="${expectedTitle}"]`).isVisible();
}
async hideColumn({ title, isPrimaryValue = false }: { title: string; isPrimaryValue?: boolean }) {
async hideColumn({ title, isDisplayValue = false }: { title: string; isDisplayValue?: boolean }) {
await this.grid.get().locator(`th[data-title="${title}"] .nc-ui-dt-dropdown`).click();
if (isPrimaryValue) {
if (isDisplayValue) {
await expect(this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field")')).toHaveCount(0);
return;
}

4
tests/playwright/tests/columnMenuOperations.spec.ts

@ -91,7 +91,7 @@ test.describe('Column menu operations', () => {
title: 'InsertBeforeColumn',
type: 'SingleLineText',
insertBeforeColumnTitle: 'Title',
isPrimaryValue: true,
isDisplayValue: true,
});
await dashboard.grid.column.create({
@ -108,7 +108,7 @@ test.describe('Column menu operations', () => {
await dashboard.grid.column.hideColumn({
title: 'Title',
isPrimaryValue: true,
isDisplayValue: true,
});
await dashboard.grid.column.hideColumn({

Loading…
Cancel
Save