Skip to content

Commit

Permalink
fix: icon loading tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuseduardomedeiros committed Aug 30, 2024
1 parent b826023 commit 8bb493e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/insights/cards/__tests__/CardDashboard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ describe('CardDashboard', () => {
it('should render the loading icon when isLoading is true', async () => {
await wrapper.setProps({ isLoading: true });
expect(wrapper.findComponent(IconLoading).exists()).toBe(true);

const metric = wrapper.find('[data-testid="card-dashboard-metric-value"]');
expect(metric.exists()).toBeFalsy();
});

it('should not render the loading icon when isLoading is false', async () => {
await wrapper.setProps({ isLoading: false });
expect(wrapper.findComponent(IconLoading).exists()).toBe(false);

const metric = wrapper.find('[data-testid="card-dashboard-metric-value"]');
expect(metric.exists()).toBeTruthy();
});

it('should display the metric value correctly when configured is true', async () => {
Expand Down

0 comments on commit 8bb493e

Please sign in to comment.