Improve code coverage

This commit is contained in:
David Lechner
2022-02-22 12:32:20 -06:00
parent b3ed75f02b
commit a0da9f7111
6 changed files with 153 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 The Pybricks Authors
import { I18nContext, I18nManager } from '@shopify/react-i18n';
import { render } from '@testing-library/react';
import { mock } from 'jest-mock-extended';
import React from 'react';
import { Provider } from 'react-redux';
import { Store } from 'redux';
import { RootState } from '../reducers';
import App from './App';
it.each([false, true])('should render', (darkMode) => {
const store = mock<Store<RootState>>({
getState: () => mock<RootState>({ settings: { darkMode } }),
});
const i18n = new I18nManager({ locale: 'en' });
render(
<Provider store={store}>
<I18nContext.Provider value={i18n}>
<App />
</I18nContext.Provider>
</Provider>,
);
});