Skip to content

Commit

Permalink
chore: drop difficult code (#9334)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Oct 3, 2024
1 parent 781cb6a commit 62ce720
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.describe('InputDate', () => {
const api = new TuiDocumentationPagePO(page);
const example = api.getExample('#sizes');

await api.prepareBeforeScreenshot(':not(#sizes)');
await api.prepareBeforeScreenshot();

for (const size of ['s', 'm', 'l']) {
const input = example
Expand Down Expand Up @@ -164,7 +164,7 @@ test.describe('InputDate', () => {
const example = api.getExample('#base');

await example.scrollIntoViewIfNeeded();
await api.prepareBeforeScreenshot(':not(#base)');
await api.prepareBeforeScreenshot();
await example.locator('tui-input-date .t-icon tui-icon').click();

await expect(page).toHaveScreenshot(`08-input-date-${language}.png`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,12 @@ export class TuiDocumentationApiPagePO {
}
}

public async prepareBeforeScreenshot(hasNot = ''): Promise<void> {
public async prepareBeforeScreenshot(): Promise<void> {
await this.hideDocumentation();
await this.hideScrollControls();
await this.hideNavigation();
await this.hideNotifications();

const wrapper = this.page.locator('tui-doc-page');
const hideElements = [
...(await wrapper
.locator(`header:not(.t-content > *:not(tui-doc-demo)${hasNot} header)`)
.all()),
...(await wrapper
.locator(`> .t-content > *:not(tui-doc-demo)${hasNot}`)
.all()),
...(await wrapper.locator('.t-bg-toggle').all()),
];

for (const element of hideElements) {
await tuiHideElement(element);
}

if ((await this.apiPageExample.all()).length) {
await this.apiPageExample.evaluate((el) => el.scrollIntoView());
await expect(async () => {
Expand Down

0 comments on commit 62ce720

Please sign in to comment.