mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-08-31 01:14:08 +08:00
fix: flaky test in ms-trophy (#69787)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import { render, screen, waitFor, within } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { I18nextProvider } from 'react-i18next';
|
||||
import { beforeAll, describe, expect, it, vi } from 'vitest';
|
||||
@@ -162,8 +162,11 @@ describe('MsTrophy', () => {
|
||||
})
|
||||
);
|
||||
|
||||
const dialog = await screen.findByRole('dialog');
|
||||
expect(dialog).toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.getByRole('heading', {
|
||||
within(dialog).getByRole('heading', {
|
||||
name: translations.buttons['get-help']
|
||||
})
|
||||
).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user