diff --git a/plugins/github-release-manager/src/cards/Cards.test.tsx b/plugins/github-release-manager/src/cards/Cards.test.tsx index dfb5491842..8be47b4d59 100644 --- a/plugins/github-release-manager/src/cards/Cards.test.tsx +++ b/plugins/github-release-manager/src/cards/Cards.test.tsx @@ -30,7 +30,7 @@ jest.mock('../contexts/ProjectContext', () => ({ import { Cards } from './Cards'; describe('Cards', () => { - it('should render info', async () => { + it('should omit cards omitted via configuration', async () => { const { getByTestId } = render( ({ useProjectContext: jest.fn(() => mockCalverProject), @@ -30,11 +30,52 @@ jest.mock('../../contexts/ProjectContext', () => ({ import { Info } from './Info'; describe('Info', () => { - it('should return early if no latestRelease exists', () => { - const { getByTestId } = render( - , + it('should return early if no latestRelease exists', async () => { + const { findByText } = render( + , ); - expect(getByTestId(TEST_IDS.info.info)).toBeInTheDocument(); + expect(await findByText(mockReleaseBranch.name)).toMatchInlineSnapshot(` + + rc/1.2.3 + + `); + + expect( + await findByText(`${mockCalverProject.owner}/${mockCalverProject.repo}`), + ).toMatchInlineSnapshot(` + + mock_owner/mock_repo + + `); + + expect(await findByText(mockCalverProject.versioningStrategy)) + .toMatchInlineSnapshot(` + + calver + + `); + + expect(await findByText(mockReleaseCandidateCalver.tagName)) + .toMatchInlineSnapshot(` + + rc-2020.01.01_1 + + `); }); });