From 645954cd825386396f14719d5aafff225cb49e3b Mon Sep 17 00:00:00 2001 From: KetineniM Date: Thu, 6 Apr 2023 14:12:31 +0530 Subject: [PATCH] JEST/RTL test cases for HoldingsMarcContainer --- .../HoldingsMarcContainer.test.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/Holding/HoldingsMarc/HoldingsMarcContainer.test.js diff --git a/src/Holding/HoldingsMarc/HoldingsMarcContainer.test.js b/src/Holding/HoldingsMarc/HoldingsMarcContainer.test.js new file mode 100644 index 000000000..12b919478 --- /dev/null +++ b/src/Holding/HoldingsMarc/HoldingsMarcContainer.test.js @@ -0,0 +1,30 @@ +import React from 'react'; +import { render, screen } from '@testing-library/react'; +import '../../../test/jest/__mock__'; +import { MemoryRouter } from 'react-router-dom'; +import HoldingsMarcContainer from './HoldingsMarcContainer'; + +jest.mock('../../components/ViewSource/ViewSource', () => jest.fn().mockReturnValue('ViewSource')); + +describe('HoldingsMarcContainer', () => { + const mutator = { + marcInstance: { + GET: jest.fn(), + }, + marcRecord: { + GET: jest.fn(), + }, + }; + + const instanceId = '123'; + const holdingsrecordid = '456'; + + it('should render a loading indicator when holdings data is loading', () => { + render( + + + + ); + expect(screen.getByText('ViewSource')).toBeInTheDocument(); + }); +});