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

chore(docs): #9644 Added top position example for ActionBar #9654

Merged
merged 7 commits into from
Nov 7, 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
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@

await expect(actionBarExample).toHaveScreenshot('01-actions-bar.png');
});

test('should show on top', async ({page}) => {
await tuiGoto(page, DemoRoute.ActionBar);
const example = page.locator('#top-position');
const showActionBarButton = example.getByTestId('open-table-bar-on-top').first();

await showActionBarButton.click();

Check failure on line 26 in projects/demo-playwright/tests/kit/action-bar/action-bar.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / ubuntu-latest / 6 of 9

[chromium] › tests/kit/action-bar/action-bar.pw.spec.ts:21:9 › ActionBar › should show on top

1) [chromium] › tests/kit/action-bar/action-bar.pw.spec.ts:21:9 › ActionBar › should show on top ─ TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for locator('#top-position').getByTestId('open-table-bar-on-top').first() 24 | const showActionBarButton = example.getByTestId('open-table-bar-on-top').first(); 25 | > 26 | await showActionBarButton.click(); | ^ 27 | const actionBarExample = page.locator('tui-action-bar'); 28 | 29 | await expect(actionBarExample).toHaveScreenshot('02-actions-bar.png'); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/kit/action-bar/action-bar.pw.spec.ts:26:35

Check failure on line 26 in projects/demo-playwright/tests/kit/action-bar/action-bar.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / ubuntu-latest / 6 of 9

[chromium] › tests/kit/action-bar/action-bar.pw.spec.ts:21:9 › ActionBar › should show on top

1) [chromium] › tests/kit/action-bar/action-bar.pw.spec.ts:21:9 › ActionBar › should show on top ─ Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for locator('#top-position').getByTestId('open-table-bar-on-top').first() 24 | const showActionBarButton = example.getByTestId('open-table-bar-on-top').first(); 25 | > 26 | await showActionBarButton.click(); | ^ 27 | const actionBarExample = page.locator('tui-action-bar'); 28 | 29 | await expect(actionBarExample).toHaveScreenshot('02-actions-bar.png'); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/kit/action-bar/action-bar.pw.spec.ts:26:35

Check failure on line 26 in projects/demo-playwright/tests/kit/action-bar/action-bar.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / ubuntu-latest / 6 of 9

[chromium] › tests/kit/action-bar/action-bar.pw.spec.ts:21:9 › ActionBar › should show on top

1) [chromium] › tests/kit/action-bar/action-bar.pw.spec.ts:21:9 › ActionBar › should show on top ─ Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for locator('#top-position').getByTestId('open-table-bar-on-top').first() 24 | const showActionBarButton = example.getByTestId('open-table-bar-on-top').first(); 25 | > 26 | await showActionBarButton.click(); | ^ 27 | const actionBarExample = page.locator('tui-action-bar'); 28 | 29 | await expect(actionBarExample).toHaveScreenshot('02-actions-bar.png'); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/kit/action-bar/action-bar.pw.spec.ts:26:35
const actionBarExample = page.locator('tui-action-bar');

await expect(actionBarExample).toHaveScreenshot('02-actions-bar.png');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<button
automation-id="open-table-bar-on-top"
tuiButton
type="button"
(click)="open.set(true)"
>
Show TableBar on top
</button>

<tui-action-bar *tuiActionBar="open()">
<span>Table bar on top opened</span>
<button
iconStart="@tui.trash"
tuiIconButton
type="button"
(click)="open.set(false)"
>
Close
</button>
</tui-action-bar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tui-action-bar {
top: 1rem;
bottom: unset;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {NgIf} from '@angular/common';
import {Component, inject, signal} from '@angular/core';
import {toSignal} from '@angular/core/rxjs-interop';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiBreakpointService, TuiButton} from '@taiga-ui/core';
import {TuiActionBar} from '@taiga-ui/kit';
import {map} from 'rxjs';

@Component({
standalone: true,
imports: [NgIf, TuiActionBar, TuiButton],
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
changeDetection,
})
export default class Example {
protected open = signal(false);

protected readonly isMobile = toSignal(
inject(TuiBreakpointService).pipe(map((size) => size === 'mobile')),
);
}
2 changes: 1 addition & 1 deletion projects/demo/src/modules/components/action-bar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ import {TuiDemo} from '@demo/utils';
changeDetection,
})
export default class Page {
protected readonly examples = ['Size M', 'Size S'];
protected readonly examples = ['Size M', 'Size S', 'Top position'];
}
Loading