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: autofocus #1397

Merged
merged 1 commit into from
Sep 25, 2024
Merged
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
5 changes: 4 additions & 1 deletion projects/editor/components/editor/editor.component.ts
Original file line number Diff line number Diff line change
@@ -81,12 +81,15 @@ import {TuiEditorPortalHost} from './portal/editor-portal-host.component';
styleUrls: ['./editor.component.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
tuiAutoFocusOptionsProvider({delay: TUI_ANIMATIONS_DEFAULT_DURATION}),
TUI_EDITOR_PROVIDERS,
{
provide: TUI_APPEARANCE_OPTIONS,
useValue: {appearance: 'textfield'},
},
tuiAutoFocusOptionsProvider({
delay: TUI_ANIMATIONS_DEFAULT_DURATION,
query: '[contenteditable].ProseMirror',
}),
],
hostDirectives: [
{

Unchanged files with check annotations Beta

test('preview display of images', async ({page}) => {
await tuiGoto(page, 'images/preview');
await expect(page.locator('tui-editor')).toHaveScreenshot('Img-02.png');

Check failure on line 19 in projects/demo-playwright/tests/img.spec.ts

GitHub Actions / E2E

[chromium] › tests/img.spec.ts:16:9 › Img › preview display of images

1) [chromium] › tests/img.spec.ts:16:9 › Img › preview display of images ───────────────────────── Error: Screenshot comparison failed: Timeout 5000ms exceeded. Expected: /home/runner/work/editor/editor/projects/demo-playwright/snapshots/tests/img.spec.ts-snapshots/Img-02-chromium-linux.png Call log: - expect.toHaveScreenshot(Img-02.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('tui-editor') - Timeout 5000ms exceeded. 17 | await tuiGoto(page, 'images/preview'); 18 | > 19 | await expect(page.locator('tui-editor')).toHaveScreenshot('Img-02.png'); | ^ 20 | }); 21 | }); 22 | at /home/runner/work/editor/editor/projects/demo-playwright/tests/img.spec.ts:19:50

Check failure on line 19 in projects/demo-playwright/tests/img.spec.ts

GitHub Actions / E2E

[chromium] › tests/img.spec.ts:16:9 › Img › preview display of images

1) [chromium] › tests/img.spec.ts:16:9 › Img › preview display of images ───────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: Timeout 5000ms exceeded. Expected: /home/runner/work/editor/editor/projects/demo-playwright/snapshots/tests/img.spec.ts-snapshots/Img-02-chromium-linux.png Call log: - expect.toHaveScreenshot(Img-02.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('tui-editor') - Timeout 5000ms exceeded. 17 | await tuiGoto(page, 'images/preview'); 18 | > 19 | await expect(page.locator('tui-editor')).toHaveScreenshot('Img-02.png'); | ^ 20 | }); 21 | }); 22 | at /home/runner/work/editor/editor/projects/demo-playwright/tests/img.spec.ts:19:50
});
});
import {expect, test} from '@playwright/test';

Check failure on line 1 in projects/demo-playwright/tests/toolbar.spec.ts

GitHub Actions / E2E

[chromium] › tests/toolbar.spec.ts:45:9 › Toolbar › has the possibility to add custom tool

2) [chromium] › tests/toolbar.spec.ts:45:9 › Toolbar › has the possibility to add custom tool ──── Test timeout of 30000ms exceeded.

Check failure on line 1 in projects/demo-playwright/tests/toolbar.spec.ts

GitHub Actions / E2E

[chromium] › tests/toolbar.spec.ts:45:9 › Toolbar › has the possibility to add custom tool

2) [chromium] › tests/toolbar.spec.ts:45:9 › Toolbar › has the possibility to add custom tool ──── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 30000ms exceeded.
import {HTML_EDITOR_BASIC_EXAMPLE} from '../stubs/html';
import {tuiGoto} from '../utils';
test('has the possibility to add custom tool', async ({page}) => {
await tuiGoto(page, '/custom-tool/paste-emoji#custom-tool');
await page.locator('[contenteditable]').nth(0).focus();

Check failure on line 48 in projects/demo-playwright/tests/toolbar.spec.ts

GitHub Actions / E2E

[chromium] › tests/toolbar.spec.ts:45:9 › Toolbar › has the possibility to add custom tool

2) [chromium] › tests/toolbar.spec.ts:45:9 › Toolbar › has the possibility to add custom tool ──── Error: locator.focus: Test timeout of 30000ms exceeded. Call log: - waiting for locator('[contenteditable]').first() 46 | await tuiGoto(page, '/custom-tool/paste-emoji#custom-tool'); 47 | > 48 | await page.locator('[contenteditable]').nth(0).focus(); | ^ 49 | 50 | await expect(page.locator('tui-editor')).toHaveScreenshot('Toolbar-05.png'); 51 | at /home/runner/work/editor/editor/projects/demo-playwright/tests/toolbar.spec.ts:48:56

Check failure on line 48 in projects/demo-playwright/tests/toolbar.spec.ts

GitHub Actions / E2E

[chromium] › tests/toolbar.spec.ts:45:9 › Toolbar › has the possibility to add custom tool

2) [chromium] › tests/toolbar.spec.ts:45:9 › Toolbar › has the possibility to add custom tool ──── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.focus: Test timeout of 30000ms exceeded. Call log: - waiting for locator('[contenteditable]').first() 46 | await tuiGoto(page, '/custom-tool/paste-emoji#custom-tool'); 47 | > 48 | await page.locator('[contenteditable]').nth(0).focus(); | ^ 49 | 50 | await expect(page.locator('tui-editor')).toHaveScreenshot('Toolbar-05.png'); 51 | at /home/runner/work/editor/editor/projects/demo-playwright/tests/toolbar.spec.ts:48:56
await expect(page.locator('tui-editor')).toHaveScreenshot('Toolbar-05.png');