-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathindex.test.tsx
More file actions
30 lines (26 loc) · 952 Bytes
/
index.test.tsx
File metadata and controls
30 lines (26 loc) · 952 Bytes
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
import React from 'react';
import { Text } from 'react-native';
import { render } from '@testing-library/react-native';
import SettingsNotification from './';
describe('SettingsNotification', () => {
it('renders children in warning variant', () => {
const { getByTestId } = render(
<SettingsNotification isWarning>
<Text testID="settings-notification-label">this is a warning</Text>
</SettingsNotification>,
);
expect(getByTestId('settings-notification-label').props.children).toBe(
'this is a warning',
);
});
it('renders children in notification variant', () => {
const { getByTestId } = render(
<SettingsNotification isWarning isNotification>
<Text testID="settings-notification-label">this is a notification</Text>
</SettingsNotification>,
);
expect(getByTestId('settings-notification-label').props.children).toBe(
'this is a notification',
);
});
});