mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
firmware/restoreOfficialDialog: add new dialog
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
import { cleanup, getByLabelText, waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { testRender } from '../../test';
|
||||
import { firmwareInstallPybricks, firmwareRestoreLego } from '../firmware/actions';
|
||||
import { firmwareInstallPybricks } from '../firmware/actions';
|
||||
import { firmwareRestoreOfficialDialogShow } from '../firmware/restoreOfficialDialog/actions';
|
||||
import Settings from './Settings';
|
||||
|
||||
afterEach(() => {
|
||||
@@ -62,7 +63,7 @@ describe('firmware', () => {
|
||||
});
|
||||
await user.click(button);
|
||||
|
||||
expect(dispatch).toHaveBeenCalledWith(firmwareRestoreLego());
|
||||
expect(dispatch).toHaveBeenCalledWith(firmwareRestoreOfficialDialogShow());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -21,8 +21,10 @@ import {
|
||||
} from '../app/constants';
|
||||
import { Button } from '../components/Button';
|
||||
import HelpButton from '../components/HelpButton';
|
||||
import { firmwareInstallPybricks, firmwareRestoreLego } from '../firmware/actions';
|
||||
import { firmwareInstallPybricks } from '../firmware/actions';
|
||||
import { InstallPybricksDialog } from '../firmware/installPybricksDialog/InstallPybricksDialog';
|
||||
import RestoreOfficialDialog from '../firmware/restoreOfficialDialog/RestoreOfficialDialog';
|
||||
import { firmwareRestoreOfficialDialogShow } from '../firmware/restoreOfficialDialog/actions';
|
||||
import { pseudolocalize } from '../i18n';
|
||||
import { useSelector } from '../reducers';
|
||||
import ExternalLinkIcon from '../utils/ExternalLinkIcon';
|
||||
@@ -108,8 +110,9 @@ const Settings: React.VoidFunctionComponent = () => {
|
||||
minimal={true}
|
||||
icon="download"
|
||||
label={i18n.translate('firmware.flashLegoButton.label')}
|
||||
onPress={() => dispatch(firmwareRestoreLego())}
|
||||
onPress={() => dispatch(firmwareRestoreOfficialDialogShow())}
|
||||
/>
|
||||
<RestoreOfficialDialog />
|
||||
</FormGroup>
|
||||
<FormGroup label={i18n.translate('help.title')}>
|
||||
<ButtonGroup minimal={true} vertical={true} alignText="left">
|
||||
|
||||
Reference in New Issue
Block a user