Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 3 additions & 75 deletions src/modal/__tests__/__snapshots__/modal.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -77,32 +77,8 @@ exports[`Test Modal Component Should Match snapshot 1`] = `
<div
class="ant-spin-nested-loading"
>
<div>
<div
aria-busy="true"
aria-live="polite"
class="ant-spin ant-spin-spinning"
>
<span
class="ant-spin-dot ant-spin-dot-spin"
>
<i
class="ant-spin-dot-item"
/>
<i
class="ant-spin-dot-item"
/>
<i
class="ant-spin-dot-item"
/>
<i
class="ant-spin-dot-item"
/>
</span>
</div>
</div>
<div
class="ant-spin-container ant-spin-blur"
class="ant-spin-container"
>
<div>
test
Expand Down Expand Up @@ -224,32 +200,8 @@ exports[`Test Modal Component Should support banner Should match snapshot for dr
<div
class="ant-spin-nested-loading"
>
<div>
<div
aria-busy="true"
aria-live="polite"
class="ant-spin ant-spin-spinning"
>
<span
class="ant-spin-dot ant-spin-dot-spin"
>
<i
class="ant-spin-dot-item"
/>
<i
class="ant-spin-dot-item"
/>
<i
class="ant-spin-dot-item"
/>
<i
class="ant-spin-dot-item"
/>
</span>
</div>
</div>
<div
class="ant-spin-container ant-spin-blur"
class="ant-spin-container"
>
test
</div>
Expand Down Expand Up @@ -366,32 +318,8 @@ exports[`Test Modal Component Should support banner Should match snapshot for re
<div
class="ant-spin-nested-loading"
>
<div>
<div
aria-busy="true"
aria-live="polite"
class="ant-spin ant-spin-spinning"
>
<span
class="ant-spin-dot ant-spin-dot-spin"
>
<i
class="ant-spin-dot-item"
/>
<i
class="ant-spin-dot-item"
/>
<i
class="ant-spin-dot-item"
/>
<i
class="ant-spin-dot-item"
/>
</span>
</div>
</div>
<div
class="ant-spin-container ant-spin-blur"
class="ant-spin-container"
>
test
</div>
Expand Down
20 changes: 20 additions & 0 deletions src/modal/__tests__/modal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,26 @@ describe('Test Modal Component', () => {
expect(asFragment()).toMatchSnapshot();
});

it('Should render Spin correct', () => {
const { container } = render(
<Modal visible title="title" getContainer={false} loading>
test
</Modal>
);
const spin = modal.query(container)!.querySelector<HTMLDivElement>('.ant-spin-blur')!;
expect(spin).toBeTruthy();
});

it('Should render no Spin correct', () => {
const { container } = render(
<Modal visible title="title" getContainer={false} loading={false}>
test
</Modal>
);
const spin = modal.query(container)!.querySelector<HTMLDivElement>('.ant-spin-blur')!;
expect(spin).toBeFalsy();
});

it('Should call onRectChange for resizable modal', () => {
const onRectChange = jest.fn();
const { container } = render(
Expand Down
2 changes: 1 addition & 1 deletion src/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function InternalModal({
position,
resizable = false,
rect,
loading,
loading = false,
onRectChange,
onPositionChange,
modalRender,
Expand Down
Loading