-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): notification content by default should be break by word (#…
- Loading branch information
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
projects/demo-playwright/tests/kit/notification/notification.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {TuiDocumentationPagePO, tuiGoto} from '@demo-playwright/utils'; | ||
import {expect, Locator, test} from '@playwright/test'; | ||
|
||
test.describe('Notification', () => { | ||
const viewports = generateDimensions(180, 320, 10); | ||
let example: Locator; | ||
|
||
test.describe('default', () => { | ||
test.beforeEach(async ({page}) => { | ||
await tuiGoto(page, '/components/notification/API'); | ||
|
||
example = new TuiDocumentationPagePO(page).apiPageExample; | ||
}); | ||
|
||
viewports.forEach(({width, height}) => { | ||
test(`width: ${width}`, async ({page}) => { | ||
await page.setViewportSize({width, height}); | ||
await expect(example).toHaveScreenshot(`01-notification-${width}.png`); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
interface Dimensions { | ||
width: number; | ||
height: number; | ||
} | ||
|
||
function generateDimensions(start: number, end: number, step: number): Dimensions[] { | ||
const viewports: Dimensions[] = []; | ||
|
||
for (let width = start; width <= end; width += step) { | ||
viewports.push({width, height: 500}); | ||
} | ||
|
||
return viewports; | ||
} |