Skip to content

Commit

Permalink
Start to update Modal.spec
Browse files Browse the repository at this point in the history
  • Loading branch information
wwahammy committed Dec 14, 2024
1 parent 1dd3279 commit 912e092
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import * as React from 'react';
import Modal, {ModalProps} from './Modal'
import {shallow, mount, ReactWrapper} from "enzyme";
import toJson from "enzyme-to-json";
import {render, screen} from '@testing-library/react'
import { DefaultCloseButton } from './DefaultCloseButton';

describe('Modal', () => {
test('nothing displayed if inactive', () => {
let modal = shallow(<Modal childGenerator={() => <div/>}/>)
let modal = render(<Modal childGenerator={() => <div/>}/>)

expect(toJson(modal)).toMatchSnapshot()
expect(modal.baseElement.outerHTML).toMatchSnapshot()
})

describe('active modal displays', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,4 @@ exports[`Modal active modal displays matches snapshot 1`] = `
</Modal>
`;

exports[`Modal nothing displayed if inactive 1`] = `""`;
exports[`Modal nothing displayed if inactive 1`] = `"<body><div></div></body>"`;

0 comments on commit 912e092

Please sign in to comment.