mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
more code coverage
This commit is contained in:
committed by
David Lechner
parent
5fa0e90783
commit
af160c99a8
@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2022-2023 The Pybricks Authors
|
||||
|
||||
import { Toast } from '@blueprintjs/core';
|
||||
import React from 'react';
|
||||
import { testRender } from '../../../test';
|
||||
import { updateServerFailure } from './UpdateServerFailure';
|
||||
|
||||
it('should dismiss when close is clicked', async () => {
|
||||
const callback = jest.fn();
|
||||
const toast = updateServerFailure(callback, undefined as never);
|
||||
|
||||
const [user, message] = testRender(<Toast {...toast} />);
|
||||
|
||||
await user.click(message.getByRole('button', { name: /close/i }));
|
||||
|
||||
expect(callback).toHaveBeenCalledWith('dismiss');
|
||||
});
|
||||
Reference in New Issue
Block a user