Skip to content

Commit

Permalink
format(pie-cookie-banner): DSW-000 updated naming for cookie banner a…
Browse files Browse the repository at this point in the history
…nd modal page object
  • Loading branch information
JoshuaNg2332 committed Mar 27, 2024
1 parent 2cbcac0 commit 120ff51
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import { test, expect } from '@sand4rt/experimental-ct-web';
import { readFile } from 'fs/promises';
import { PieCookieBannerComponent, Level } from 'test/helpers/page-object/pie-cookie-banner.page.ts';
import { PieModalPage } from '@justeattakeaway/pie-modal/test/helpers/page-object/pie-modal.page.ts';
import { CookieBannerComponent, Level } from 'test/helpers/page-object/pie-cookie-banner.page.ts';
import { ModalComponent } from '@justeattakeaway/pie-modal/test/helpers/page-object/pie-modal.page.ts';
import {
ON_COOKIE_BANNER_ACCEPT_ALL, ON_COOKIE_BANNER_NECESSARY_ONLY,
ON_COOKIE_BANNER_MANAGE_PREFS, ON_COOKIE_BANNER_PREFS_SAVED,
Expand All @@ -19,13 +19,13 @@ function stripTags (str: string) {
return str.replace(/<\/?[^>]+(>|$)/g, '');
}

let pieCookieBannerComponent: PieCookieBannerComponent;
let pieModalComponent: PieModalPage;
let pieCookieBannerComponent: CookieBannerComponent;
let pieModalComponent: ModalComponent;

test.describe('PieCookieBanner - Component tests', () => {
test.beforeEach(async ({ page }) => {
pieCookieBannerComponent = new PieCookieBannerComponent(page);
pieModalComponent = new PieModalPage(page);
pieCookieBannerComponent = new CookieBannerComponent(page);
pieModalComponent = new ModalComponent(page);
});

test('should render successfully', async ({ mount }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getPreferenceItemSelector = (id: PreferenceIds) => `#${id} [data-test-id="

export type Level = 'action' | 'body';

export class PieCookieBannerComponent extends BasePage {
export class CookieBannerComponent extends BasePage {
private readonly componentLocator: Locator;
private readonly descriptionLocator: Locator;
private readonly acceptAllButtonLocator: Locator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type Page } from '@playwright/test';
import {
WebComponentTestWrapper,
} from '@justeattakeaway/pie-webc-testing/src/helpers/components/web-component-test-wrapper/WebComponentTestWrapper.ts';
import { PieModalComponent } from 'test/helpers/page-object/pie-modal.page.ts';
import { ModalComponent } from 'test/helpers/page-object/pie-modal.page.ts';
import { createScrollablePageHTML, renderTestPieModal } from '../helpers/index.ts';

import { PieModal } from '../../src/index.ts';
Expand All @@ -15,11 +15,11 @@ import {
headingLevels,
} from '../../src/defs.ts';

let modalPage: PieModalComponent;
let modalPage: ModalComponent;

test.describe('modal', () => {
test.beforeEach(async ({ page }) => {
modalPage = new PieModalComponent(page);
modalPage = new ModalComponent(page);
});

test('should be visible when opened', async ({ mount }) => {
Expand Down Expand Up @@ -251,7 +251,7 @@ test.describe('modal', () => {
[{
mechanism: 'close button',
modalCloseFunction: async (page : Page) => {
const modalPage = new PieModalComponent(page);
const modalPage = new ModalComponent(page);
await modalPage.clickCloseModal();
},
}, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
modal,
} from './selectors.ts';

export class PieModalComponent extends BasePage {
export class ModalComponent extends BasePage {
private readonly componentLocator: Locator;
private readonly backButtonLocator: Locator;
private readonly closeButtonLocator: Locator;
Expand Down

0 comments on commit 120ff51

Please sign in to comment.