Skip to content

Commit

Permalink
test(client): fix test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme authored and nikku committed Apr 11, 2024
1 parent d5fc08e commit 6245e57
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

import React from 'react';

import { act } from 'react-dom/test-utils';

import {
mount,
shallow
Expand Down Expand Up @@ -145,13 +147,21 @@ describe('<DeploymentConfigOverlay>', () => {
}, mount);

// when
instance.setState({ isAuthNeeded: true });
act(() => {
instance.setState({ isAuthNeeded: true });
});

instance.isOnBeforeSubmit = true;
wrapper.find('.btn-primary').simulate('submit');

wrapper.update();

act(() => {
wrapper.find('.btn-primary').simulate('submit');
});

// then
setTimeout(() => {
wrapper.setProps({});
wrapper.update();

try {
expect(wrapper.find('.invalid-feedback')).to.have.length(1);
Expand Down

0 comments on commit 6245e57

Please sign in to comment.