Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): notification content by default should be break by word #6611

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"retrowave",
"replicants",
"tuiiconbutton",
"hitbox"
"hitbox",
"viewports"
],
"ignoreRegExpList": ["\\(https?://.*?\\)", "\\/{1}.+\\/{1}", "\\%2F.+", "\\%2C.+", "\\ɵ.+", "\\ыва.+"],
"overrides": [
Expand Down
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;
}
Loading