mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
add tests for StatusBar
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import { createStore } from 'redux';
|
||||
import { rootReducer } from '../reducers';
|
||||
import StatusBar from './StatusBar';
|
||||
|
||||
it('should prevent browser context menu', () => {
|
||||
const store = createStore(rootReducer);
|
||||
render(
|
||||
<Provider store={store}>
|
||||
<StatusBar />
|
||||
</Provider>,
|
||||
);
|
||||
|
||||
expect(fireEvent.contextMenu(screen.getByRole('status'))).toBe(false);
|
||||
});
|
||||
@@ -11,6 +11,8 @@ class StatusBar extends React.Component {
|
||||
return (
|
||||
<div
|
||||
className="pb-status-bar"
|
||||
role="status"
|
||||
aria-live="off"
|
||||
onContextMenu={(e): void => e.preventDefault()}
|
||||
></div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user