mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-15 17:46:39 +00:00
Fix flaky Cypress test (#6415)
* Fix flaky Cypress test * Add jest fake timers
This commit is contained in:
parent
ea918495ff
commit
fe7151e870
@ -197,7 +197,6 @@ export const deleteCreatedService = (typeOfService, service_Name) => {
|
||||
.type('DELETE');
|
||||
cy.get('[data-testid="confirm-button"]').should('be.visible').click();
|
||||
cy.wait(2000);
|
||||
cy.get('.tw-modal-container').should('not.exist');
|
||||
cy.get('[class="Toastify__toast-body"] >div')
|
||||
.eq(1)
|
||||
.should('exist')
|
||||
|
||||
@ -56,4 +56,7 @@ module.exports = {
|
||||
|
||||
// Sonar Cloud Configuration
|
||||
testResultsProcessor: 'jest-sonar-reporter',
|
||||
|
||||
// use fake timers
|
||||
timers: 'fake',
|
||||
};
|
||||
|
||||
@ -23,6 +23,8 @@ import PopOver from './PopOver';
|
||||
|
||||
let global;
|
||||
|
||||
jest.useRealTimers();
|
||||
|
||||
global.document.createRange = () => ({
|
||||
setStart: jest.fn(),
|
||||
setEnd: jest.fn(),
|
||||
|
||||
@ -15,6 +15,8 @@ import { fireEvent, getByTestId, render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import Searchbar from './Searchbar';
|
||||
|
||||
jest.useRealTimers();
|
||||
|
||||
describe('Test Searchbar Component', () => {
|
||||
it('Renders the searchbar with the search text sent to it', () => {
|
||||
const onSearch = jest.fn();
|
||||
|
||||
@ -57,6 +57,8 @@ const mockUseHistory = {
|
||||
push: jest.fn(),
|
||||
};
|
||||
|
||||
jest.useRealTimers();
|
||||
|
||||
jest.mock('../../AppState', () => ({
|
||||
userDetails: {
|
||||
name: 'test',
|
||||
|
||||
@ -21,6 +21,8 @@ import {
|
||||
import { MOCK_GLOSSARY } from './glossary.mock';
|
||||
import GlossaryPageV1 from './GlossaryPageV1.component';
|
||||
|
||||
jest.useRealTimers();
|
||||
|
||||
jest.mock('react-router-dom', () => ({
|
||||
useHistory: () => ({
|
||||
push: jest.fn(),
|
||||
|
||||
@ -43,6 +43,8 @@ const MOCK_HISTORY = {
|
||||
push: jest.fn(),
|
||||
};
|
||||
|
||||
jest.useRealTimers();
|
||||
|
||||
jest.mock('../../components/containers/PageContainerV1', () => {
|
||||
return jest
|
||||
.fn()
|
||||
|
||||
@ -30,6 +30,8 @@ import {
|
||||
} from '../../axiosAPIs/tagAPI';
|
||||
import { getTagCategories } from '../../utils/TagsUtils';
|
||||
|
||||
jest.useRealTimers();
|
||||
|
||||
jest.mock('../../authentication/auth-provider/AuthProvider', () => {
|
||||
return {
|
||||
useAuthContext: jest.fn(() => ({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user