blob: dd6bef62276635c6f4cee4d072729e245ef6d3a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
import { describe, expect, it } from '@jest/globals';
import { render, screen as rtlScreen } from '@testing-library/react';
import { Notice } from './notice';
describe('Notice', () => {
it('can render an error notice', () => {
const body = 'culpa sint ut';
render(<Notice kind="error">{body}</Notice>);
expect(rtlScreen.getByText(body)).toHaveClass('notice--error');
});
it('can render an informative notice', () => {
const body = 'labore optio rerum';
render(<Notice kind="info">{body}</Notice>);
expect(rtlScreen.getByText(body)).toHaveClass('notice--info');
});
it('can render a success notice', () => {
const body = 'dolorem voluptatem velit';
render(<Notice kind="success">{body}</Notice>);
expect(rtlScreen.getByText(body)).toHaveClass('notice--success');
});
it('can render a warning notice', () => {
const body = 'ut non nihil';
render(<Notice kind="warning">{body}</Notice>);
expect(rtlScreen.getByText(body)).toHaveClass('notice--warning');
});
});
|