-
-
Notifications
You must be signed in to change notification settings - Fork 757
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Migrated test from jest to Vitest for all components of OrganizationDashCards component and also merged css files into global css file * Migrated test from jest to Vitest for all components of OrganizationDashCards component and also merged css files into global css file * coderabbit issue resolved * Git check resolved * git issue resolved * git issue resolved * git requested changes * resolved conversation * git resolved conversation * requested changes * resolved issue * updated branch * codrabbit issue resolved
- Loading branch information
1 parent
ac36851
commit c364d0d
Showing
11 changed files
with
233 additions
and
178 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import CardItem from './CardItem'; | ||
import type { InterfaceCardItem } from './CardItem'; | ||
import dayjs from 'dayjs'; | ||
import React from 'react'; | ||
|
||
describe('Testing the Organization Card', () => { | ||
test('Should render props and text elements For event card', () => { | ||
|
@@ -36,7 +36,6 @@ describe('Testing the Organization Card', () => { | |
email: '[email protected]', | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
__typename: 'User', | ||
_id: '1', | ||
}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/components/OrganizationDashCards/CardItemLoading.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import CardItemLoading from './CardItemLoading'; | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import styles from '../../style/app.module.css'; | ||
describe('Test the CardItemLoading component', () => { | ||
test('Should render the component', () => { | ||
render(<CardItemLoading />); | ||
expect(screen.getByTestId('cardItemLoading')).toBeInTheDocument(); | ||
}); | ||
|
||
test('Should render all required child elements', () => { | ||
render(<CardItemLoading />); | ||
|
||
const cardItemLoading = screen.getByTestId('cardItemLoading'); | ||
expect(cardItemLoading).toBeInTheDocument(); | ||
|
||
const iconWrapper = cardItemLoading.querySelector(`.${styles.iconWrapper}`); | ||
expect(iconWrapper).toBeInTheDocument(); | ||
|
||
const title = cardItemLoading.querySelector(`.${styles.title}`); | ||
expect(title).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/components/OrganizationDashCards/DashBoardCardLoading.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import DashBoardCardLoading from './DashboardCardLoading'; | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import styles from '../../style/app.module.css'; | ||
describe('Testing the DashBoardCardLoading component', () => { | ||
beforeEach(() => { | ||
render(<DashBoardCardLoading />); | ||
}); | ||
test('should render the component', () => { | ||
expect(screen.getByTestId('Card')).toBeInTheDocument(); | ||
}); | ||
|
||
test('should render every children elements of the component', () => { | ||
const Card = screen.queryByTestId('Card'); | ||
const CardBody = Card?.querySelector(`.${styles.cardBody}`); | ||
expect(CardBody).toBeInTheDocument(); | ||
const iconWrapper = Card?.querySelector(`.${styles.iconWrapper}`); | ||
expect(iconWrapper).toBeInTheDocument(); | ||
const themeOverlay = Card?.querySelector(`.${styles.themeOverlay}`); | ||
expect(themeOverlay).toBeInTheDocument(); | ||
const textWrapper = Card?.querySelector(`.${styles.textWrapper}`); | ||
expect(textWrapper).toBeInTheDocument(); | ||
const primaryText = Card?.querySelector(`.${styles.primaryText}`); | ||
expect(primaryText).toBeInTheDocument(); | ||
const secondaryText = Card?.querySelector(`.${styles.secondaryText}`); | ||
expect(secondaryText).toBeInTheDocument(); | ||
}); | ||
}); |
3 changes: 1 addition & 2 deletions
3
...anizationDashCards/DashboardCard.test.tsx → ...anizationDashCards/DashboardCard.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
src/components/OrganizationDashCards/Dashboardcard.module.css
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.