* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { screen } from '@testing-library/react';
+import { act, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import ComputeEngineServiceMock from '../../../api/mocks/ComputeEngineServiceMock';
import { ProjectDumpServiceMock } from '../../../api/mocks/ProjectDumpServiceMock';
status: TaskStatuses.Pending,
submittedAt: '2023-06-08T11:55:00Z',
});
+
await userEvent.click(await ui.exportBtn.find());
expect(await ui.pendingExport.find()).toBeInTheDocument();
expect(ui.exportBtn.query()).not.toBeInTheDocument();
status: TaskStatuses.InProgress,
startedAt: '2023-06-08T12:00:00Z',
});
- jest.runOnlyPendingTimers();
+ act(() => {
+ jest.runOnlyPendingTimers();
+ });
expect(await ui.inProgressExport.find()).toBeInTheDocument();
expect(ui.exportBtn.query()).not.toBeInTheDocument();
status: TaskStatuses.Failed,
executedAt: '2023-06-08T12:05:00Z',
});
- jest.runOnlyPendingTimers();
+ act(() => {
+ jest.runOnlyPendingTimers();
+ });
expect(await ui.failedExport.find()).toBeInTheDocument();
expect(ui.exportBtn.get()).toBeInTheDocument();
});
status: TaskStatuses.InProgress,
startedAt: '2023-06-08T12:00:00Z',
});
- jest.runOnlyPendingTimers();
+ act(() => {
+ jest.runOnlyPendingTimers();
+ });
expect(await ui.inProgressImport.find()).toBeInTheDocument();
expect(ui.importBtn.query()).not.toBeInTheDocument();
status: TaskStatuses.Failed,
executedAt: '2023-06-08T12:05:00Z',
});
- jest.runOnlyPendingTimers();
+ act(() => {
+ jest.runOnlyPendingTimers();
+ });
expect(await ui.failedImport.find()).toBeInTheDocument();
expect(ui.importBtn.get()).toBeInTheDocument();
});
never_trust_user_input: NeverTrustUserInput,
};
-export default class MoreInfoRuleDescription extends React.PureComponent<Props, {}> {
+export default class MoreInfoRuleDescription extends React.PureComponent<Props> {
handleNotificationScroll = () => {
const element = this.props.educationPrinciplesRef?.current;
background-color: ${themeColor('educationPrincipleBackground')};
border: ${themeBorder('default', 'educationPrincipleBorder')};
- & h3:first-child {
- margin-top: 0px;
+ & h3:first-of-type {
+ margin-top: 0;
}
`;