From 4d6ac137669baa8b60711aeacd357aabd6aa9b7c Mon Sep 17 00:00:00 2001 From: khushi patil Date: Wed, 25 Dec 2024 15:00:31 +0530 Subject: [PATCH 1/3] convert test from jest to vitest --- src/components/Loader/{Loader.test.tsx => Loader.spec.tsx} | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename src/components/Loader/{Loader.test.tsx => Loader.spec.tsx} (77%) diff --git a/src/components/Loader/Loader.test.tsx b/src/components/Loader/Loader.spec.tsx similarity index 77% rename from src/components/Loader/Loader.test.tsx rename to src/components/Loader/Loader.spec.tsx index c512b480e3..552a37f53f 100644 --- a/src/components/Loader/Loader.test.tsx +++ b/src/components/Loader/Loader.spec.tsx @@ -1,23 +1,24 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import Loader from './Loader'; +import {describe,it} from 'vitest'; describe('Testing Loader component', () => { - test('Component should be rendered properly', () => { + it('Component should be rendered properly', () => { render(); expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument(); expect(screen.getByTestId('spinner')).toBeInTheDocument(); }); - test('Component should render on custom sizes', () => { + it('Component should render on custom sizes', () => { render(); expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument(); expect(screen.getByTestId('spinner')).toBeInTheDocument(); }); - test('Component should render with large size', () => { + it('Component should render with large size', () => { render(); expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument(); From 4b9a0a24cc5e0da0768b0427237ca05ba91756ed Mon Sep 17 00:00:00 2001 From: khushi patil Date: Wed, 25 Dec 2024 15:10:08 +0530 Subject: [PATCH 2/3] convert test from jest to vitest --- src/components/Loader/Loader.spec.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Loader/Loader.spec.tsx b/src/components/Loader/Loader.spec.tsx index 552a37f53f..2e961792a7 100644 --- a/src/components/Loader/Loader.spec.tsx +++ b/src/components/Loader/Loader.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import Loader from './Loader'; -import {describe,it} from 'vitest'; +import { describe, it } from 'vitest'; describe('Testing Loader component', () => { it('Component should be rendered properly', () => { From 6eb509952f2a67de0b1a9d3ed8bd5237233b924b Mon Sep 17 00:00:00 2001 From: khushi patil Date: Wed, 25 Dec 2024 15:20:26 +0530 Subject: [PATCH 3/3] convert test from jest to vitest --- src/components/Loader/Loader.spec.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/Loader/Loader.spec.tsx b/src/components/Loader/Loader.spec.tsx index 2e961792a7..0527426bea 100644 --- a/src/components/Loader/Loader.spec.tsx +++ b/src/components/Loader/Loader.spec.tsx @@ -1,26 +1,23 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import Loader from './Loader'; -import { describe, it } from 'vitest'; +import { describe, it, expect } from 'vitest'; describe('Testing Loader component', () => { - it('Component should be rendered properly', () => { + it('should render the component properly', () => { render(); - expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument(); expect(screen.getByTestId('spinner')).toBeInTheDocument(); }); - it('Component should render on custom sizes', () => { + it('should render the component with custom sizes', () => { render(); - expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument(); expect(screen.getByTestId('spinner')).toBeInTheDocument(); }); - it('Component should render with large size', () => { + it('should render the component with large size', () => { render(); - expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument(); expect(screen.getByTestId('spinner')).toBeInTheDocument(); });