-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
268 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
packages/svelte-lexical/src/lib/components/richtext/RichTextComposer.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { expect, test } from 'vitest'; | ||
import { render } from '@testing-library/svelte' | ||
//import userEvent from '@testing-library/user-event' | ||
|
||
import RichTextComposer from '$lib/components/richtext/RichTextComposer.svelte'; | ||
|
||
test('have Bold button in toolbar', () => { | ||
const { getByLabelText } = render(RichTextComposer, {}); | ||
|
||
expect(getByLabelText('Format text as bold. Shortcut: Ctrl+B')).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import {sveltekit} from '@sveltejs/kit/vite'; | ||
import {defineConfig} from 'vitest/config'; | ||
|
||
export default defineConfig({ | ||
export default defineConfig(({mode}) => ({ | ||
plugins: [sveltekit()], | ||
resolve: { | ||
conditions: mode === 'test' ? ['browser'] : [], | ||
}, | ||
test: { | ||
include: ['src/**/*.{test,spec}.{js,ts}'], | ||
environment: 'jsdom', | ||
setupFiles: ['./vitest-setup.ts'], | ||
}, | ||
}); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import '@testing-library/svelte/vitest'; | ||
import '@testing-library/jest-dom/vitest'; | ||
|
||
import {beforeAll, vi} from 'vitest'; | ||
|
||
beforeAll(() => { | ||
// jsdom doens't support html dialog yet - https://github.com/jsdom/jsdom/issues/3294 | ||
HTMLDialogElement.prototype.show = vi.fn(); | ||
HTMLDialogElement.prototype.showModal = vi.fn(); | ||
HTMLDialogElement.prototype.close = vi.fn(); | ||
}); |
Oops, something went wrong.