Skip to content

Commit 7104b89

Browse files
committed
Add tests
1 parent 09c8190 commit 7104b89

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/components/modal/__tests__/Modal.test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ describe('Modal', () => {
7575
'custom-modal-content'
7676
);
7777

78+
// Content style
79+
rerender(<Modal is_open content_style={{backgroundColor: 'red'}} />);
80+
expect(document.body.querySelector('.modal-content')).toHaveStyle({
81+
backgroundColor: 'red'
82+
});
83+
7884
// Backdrop class name
7985
rerender(<Modal is_open backdrop_class_name="custom-modal-backdrop" />);
8086
expect(document.body.querySelector('.modal-backdrop')).toHaveClass(
@@ -87,6 +93,19 @@ describe('Modal', () => {
8793
'custom-modal-dialog'
8894
);
8995

96+
// Dialog style
97+
rerender(
98+
<Modal
99+
is_open
100+
dialog_style={{position: 'absolute', top: '10px', left: '10px'}}
101+
/>
102+
);
103+
expect(document.body.querySelector('.modal-dialog')).toHaveStyle({
104+
position: 'absolute',
105+
top: '10px',
106+
left: '10px'
107+
});
108+
90109
// Modal class name
91110
rerender(<Modal is_open modal_class_name="custom-modal-class" />);
92111
expect(document.body.querySelector('.modal')).toHaveClass(

0 commit comments

Comments
 (0)