diff options
Diffstat (limited to 'src/lib/components/actions/topic.test.ts')
| -rw-r--r-- | src/lib/components/actions/topic.test.ts | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib/components/actions/topic.test.ts b/src/lib/components/actions/topic.test.ts new file mode 100644 index 0000000..0037a7f --- /dev/null +++ b/src/lib/components/actions/topic.test.ts @@ -0,0 +1,29 @@ +/** + * @jest-environment jsdom + */ + +import '@testing-library/jest-dom/extend-expect'; + +import { render } from '@testing-library/svelte'; +import '$lib/i18n'; + +import Topic from './topic.svelte'; + +const internals = { + results: null +}; + +describe('Topic Actions component', () => { + + test('Should link to reply page', () => { + + const results = render(Topic, { props: { + actions: { + id: '8ebaa211-fd9b-423a-8b4f-b57622007fde' + } + } }); + + expect(results.getByTitle('Reply').closest('a')) + .toHaveAttribute('href', '/reply/8ebaa211-fd9b-423a-8b4f-b57622007fde'); + }); +}); |