Files
pybricks-code/src/status-bar/StatusBar.test.tsx
T
David Lechner 8d4680ba82 status-bar: add connected hub indicator
This adds an indicator to the status bar that shows the hub name. When
clicked, a popover will be displayed that lists more detailed information
about the connected hub.
2021-12-27 13:04:13 -06:00

27 lines
799 B
TypeScript

// SPDX-License-Identifier: MIT
// Copyright (c) 2021 The Pybricks Authors
import { fireEvent, render, screen } from '@testing-library/react';
import React from 'react';
import { Provider } from 'react-redux';
import { Store } from 'redux';
import { BleConnectionState } from '../ble/reducers';
import StatusBar from './StatusBar';
it('should prevent browser context menu', () => {
const store = {
getState: jest.fn(() => ({
ble: { connection: BleConnectionState.Disconnected, deviceName: '' },
})),
dispatch: jest.fn(),
subscribe: jest.fn(),
} as unknown as Store;
render(
<Provider store={store}>
<StatusBar />
</Provider>,
);
expect(fireEvent.contextMenu(screen.getByRole('status'))).toBe(false);
});