Skip to content

Commit

Permalink
test(HMS-2994): confirm domain deletion
Browse files Browse the repository at this point in the history
Add the skeleton for the unit test.

Signed-off-by: Alejandro Visiedo <[email protected]>
  • Loading branch information
avisiedo committed Apr 23, 2024
1 parent 685fa7d commit f87ce9b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Components/ConfirmDeleteDomain/ConfirmDeleteDomain.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import ConfirmDeleteDomain from './ConfirmDeleteDomain';
import '@testing-library/jest-dom';
import { Domain } from '../../Api';

const domain: Domain = {} as Domain;

test('expect empty when isOpen is false', () => {
const root = render(<ConfirmDeleteDomain domain={domain} isOpen={false} />);
expect(root.container).toBeEmptyDOMElement();
});

test('expect modal displayed', () => {
const root = render(<ConfirmDeleteDomain domain={domain} isOpen={true} />);
root.debug();

expect(screen.getByRole('heading')).toHaveTextContent('Delete identity domain registration');
// TODO Add more expectations
});

0 comments on commit f87ce9b

Please sign in to comment.