fecd15f862
I could imagine that we will refactor this into even smaller components in the future but for now, I bundle the pronoun with the display name like this. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
20 lines
590 B
TypeScript
20 lines
590 B
TypeScript
import '@testing-library/jest-dom';
|
|
import { render, screen } from '@testing-library/svelte';
|
|
|
|
import DisplayName from '../../../src/lib/components/atoms/DisplayName.svelte';
|
|
|
|
describe('DisplayName.svelte', () => {
|
|
it('should mount', () => {
|
|
// Arrange
|
|
const displayName = 'Jane Doe';
|
|
const pronoun = 'she/her';
|
|
|
|
// Act
|
|
render(DisplayName, { displayName, pronoun });
|
|
|
|
// Assert
|
|
expect(screen.getByText(displayName)).toBeInTheDocument();
|
|
// Turn into regular expression to respect round brackets
|
|
expect(screen.getByText(new RegExp(pronoun))).toBeInTheDocument();
|
|
});
|
|
});
|