Skip to content

Commit

Permalink
feat(core): notification content by default should be break by word
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Jan 31, 2024
1 parent 0bdb787 commit e2a8c50
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@

.t-content {
flex: 1;
word-wrap: break-word;
overflow-wrap: anywhere;
word-break: break-word;
color: var(--tui-text-01);
}
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;
}

0 comments on commit e2a8c50

Please sign in to comment.