mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
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.
27 lines
799 B
TypeScript
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);
|
|
});
|