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

fix(kit): TasbWithMore fix redundant left margin for single element #7022

Merged
merged 1 commit into from
Mar 19, 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
8 changes: 8 additions & 0 deletions projects/demo-playwright/tests/kit/tabs/tabs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,12 @@
});
});
});

test('Single button', async ({page}) => {
await tuiGoto(page, '/navigation/tabs/API?activeItemIndex=2&sandboxWidth=133');

await expect(new TuiDocumentationPagePO(page).apiPageExample).toHaveScreenshot(

Check failure on line 50 in projects/demo-playwright/tests/kit/tabs/tabs.spec.ts

View workflow job for this annotation

GitHub Actions / playwright / (8 of 8)

[chromium] › tests/kit/tabs/tabs.spec.ts:47:9 › Tabs › Single button

1) [chromium] › tests/kit/tabs/tabs.spec.ts:47:9 › Tabs › Single button ────────────────────────── Error: Screenshot comparison failed: 1760 pixels (ratio 0.06 of all image pixels) are different. Expected: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/kit/tabs/tabs.spec.ts-snapshots/03-tabs-single-item-01-chromium-linux.png Received: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-kit-tabs-tabs-Tabs-Single-button-chromium/03-tabs-single-item-01-actual.png Diff: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-kit-tabs-tabs-Tabs-Single-button-chromium/03-tabs-single-item-01-diff.png Call log: - page._expectScreenshot with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-tui-demo-c235710164…>…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 1760 pixels (ratio 0.06 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-tui-demo-c235710164…>…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 1760 pixels (ratio 0.06 of all image pixels) are different. 48 | await tuiGoto(page, '/navigation/tabs/API?activeItemIndex=2&sandboxWidth=133'); 49 | > 50 | await expect(new TuiDocumentationPagePO(page).apiPageExample).toHaveScreenshot( | ^ 51 | '03-tabs-single-item-01.png', 52 | ); 53 | }); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/kit/tabs/tabs.spec.ts:50:71

Check failure on line 50 in projects/demo-playwright/tests/kit/tabs/tabs.spec.ts

View workflow job for this annotation

GitHub Actions / playwright / (8 of 8)

[chromium] › tests/kit/tabs/tabs.spec.ts:47:9 › Tabs › Single button

1) [chromium] › tests/kit/tabs/tabs.spec.ts:47:9 › Tabs › Single button ────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: 1760 pixels (ratio 0.06 of all image pixels) are different. Expected: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/kit/tabs/tabs.spec.ts-snapshots/03-tabs-single-item-01-chromium-linux.png Received: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-kit-tabs-tabs-Tabs-Single-button-chromium-retry1/03-tabs-single-item-01-actual.png Diff: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-kit-tabs-tabs-Tabs-Single-button-chromium-retry1/03-tabs-single-item-01-diff.png Call log: - page._expectScreenshot with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-tui-demo-c235710164…>…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 1760 pixels (ratio 0.06 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-tui-demo-c235710164…>…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 1760 pixels (ratio 0.06 of all image pixels) are different. 48 | await tuiGoto(page, '/navigation/tabs/API?activeItemIndex=2&sandboxWidth=133'); 49 | > 50 | await expect(new TuiDocumentationPagePO(page).apiPageExample).toHaveScreenshot( | ^ 51 | '03-tabs-single-item-01.png', 52 | ); 53 | }); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/kit/tabs/tabs.spec.ts:50:71

Check failure on line 50 in projects/demo-playwright/tests/kit/tabs/tabs.spec.ts

View workflow job for this annotation

GitHub Actions / playwright / (8 of 8)

[chromium] › tests/kit/tabs/tabs.spec.ts:47:9 › Tabs › Single button

1) [chromium] › tests/kit/tabs/tabs.spec.ts:47:9 › Tabs › Single button ────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: 1760 pixels (ratio 0.06 of all image pixels) are different. Expected: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/kit/tabs/tabs.spec.ts-snapshots/03-tabs-single-item-01-chromium-linux.png Received: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-kit-tabs-tabs-Tabs-Single-button-chromium-retry2/03-tabs-single-item-01-actual.png Diff: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-kit-tabs-tabs-Tabs-Single-button-chromium-retry2/03-tabs-single-item-01-diff.png Call log: - page._expectScreenshot with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-tui-demo-c235710164…>…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 1760 pixels (ratio 0.06 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-tui-demo-c235710164…>…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 1760 pixels (ratio 0.06 of all image pixels) are different. 48 | await tuiGoto(page, '/navigation/tabs/API?activeItemIndex=2&sandboxWidth=133'); 49 | > 50 | await expect(new TuiDocumentationPagePO(page).apiPageExample).toHaveScreenshot( | ^ 51 | '03-tabs-single-item-01.png', 52 | ); 53 | }); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/kit/tabs/tabs.spec.ts:50:71
'03-tabs-single-item-01.png',
);
});
});
7 changes: 5 additions & 2 deletions projects/kit/components/tabs/tab/tab.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@

:host-context(tui-tabs >):first-child,
:host-context([tuiTabs] >):first-child,
:host-context(tui-tabs > :first-child),
:host-context([tuiTabs] > :first-child) {
:host-context(tui-tabs > :not(.t-overflown) >):first-child {
margin-left: 0;
}

:host-context(tui-tabs > [tuiTab] ~ :not(.t-overflown) >):first-child {
margin-left: var(--tui-tab-margin, 1.5rem);
vladimirpotekhin marked this conversation as resolved.
Show resolved Hide resolved
}

:host {
.transition(~'color, box-shadow, opacity, background');
.clearbtn();
Expand Down
Loading