github.com/freiheit-com/kuberpult@v1.24.2-0.20240328135542-315d5630abe6/services/frontend-service/src/ui/components/Spinner/Spinner.test.tsx (about) 1 /*This file is part of kuberpult. 2 3 Kuberpult is free software: you can redistribute it and/or modify 4 it under the terms of the Expat(MIT) License as published by 5 the Free Software Foundation. 6 7 Kuberpult is distributed in the hope that it will be useful, 8 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 MIT License for more details. 11 12 You should have received a copy of the MIT License 13 along with kuberpult. If not, see <https://directory.fsf.org/wiki/License:Expat>. 14 15 Copyright 2023 freiheit.com*/ 16 import { render } from '@testing-library/react'; 17 import React from 'react'; 18 import { Spinner } from './Spinner'; 19 20 const cases: { name: string }[] = [ 21 { 22 name: 'Renders', 23 }, 24 ]; 25 26 describe('Spinner', () => { 27 const getNode = () => <Spinner message={'hello'} />; 28 const getWrapper = () => render(getNode()); 29 30 describe.each(cases)('Renders', (testcase) => { 31 it(testcase.name, () => { 32 //given 33 // when 34 const { container } = getWrapper(); 35 // then 36 expect(container.firstChild).toMatchSnapshot(); 37 }); 38 }); 39 });