add import and export capabilities for devices and suites#1268
add import and export capabilities for devices and suites#1268manojVivek merged 8 commits intoresponsively-org:mainfrom
Conversation
manojVivek
left a comment
There was a problem hiding this comment.
You pulled it off so nicely!! 👏🏼
Just a couple of minor things, looks great otherwise!
| window.electron.store.set('deviceManager.previewSuites', []); | ||
| state.suites = action.payload; | ||
| state.activeSuite = action.payload[0].id; | ||
| window.electron.store.set('deviceManager.previewSuites', action.payload); |
There was a problem hiding this comment.
This looks like it will override the existing suites as well, wouldn't that result in a loss of data if the user already had any custom suites?
I just noticed that there was a warning message indicating this, should we try to append it to the existing suites instead of replacing it?
There was a problem hiding this comment.
sure, should we add also a button to reset the whole thing so they can go to the initial clean state as well?
.all-contributorsrc
Outdated
| "contributions": [ | ||
| "code" | ||
| ] | ||
| }, |
There was a problem hiding this comment.
You can remove this, as it will be autopopulated by allContributors bot that updates the README as well.
| const mockHandleUpload = jest.fn(); | ||
| const mockResetUploadedFile = jest.fn(); | ||
|
|
||
| describe('FileUploader', () => { |
There was a problem hiding this comment.
Really appreciate the unit tests! 🫡
There was a problem hiding this comment.
I wanted to add more on the ManageSuitesTool but I am having issues with the electron store, I can't seem to mock it. Do you have any idea how to mock it properly?
This is the error:
FAIL src/renderer/components/DeviceManager/PreviewSuites/ManageSuitesTool/ManageSuitesTool.test.tsx
● Test suite failed to run
TypeError: Cannot read properties of undefined (reading 'store')
4 | import { sanitizeSuites } from './utils';
5 |
> 6 | const activeDeviceIds: string[] = window.electron.store.get(
| ^
7 | 'deviceManager.activeDevices'
8 | );
9 |
There was a problem hiding this comment.
Maybe we need to add a mock electron object to the window before the test runs?
Something like this:
electron-mock.ts
const store = {};
window.electron = {
store: {
get: (key: string) => {
return store[key];
},
set: (key: string, val: any) => {
store[key] = val;
}
}
};
And then import this file at the top of the test file?
(haven't thought this through, just a quick suggestion)
There was a problem hiding this comment.
I tried, I think we need to add a setup file for jest in the root. I will investigate further in a different pr
| onClick={() => setOpen(true)} | ||
| > | ||
| <Icon | ||
| icon="mdi:folder-upload" |
There was a problem hiding this comment.
I'm leaning towards uil:import and uil:export for the icons?
As the current ones look more like a folder import/export to me. Wdyt?
|
Now instead of replacing, it merges whatever was there with the new. replace.mp4Also implements accordion and rearranges UI newui.mp4 |
remove changes
|
Merging this in now. You pulled it off so great for your first commit to the repo! @violetadev 👏🏼 Thank you so much! Looking forward to more like this in the future. |
|
@all-contributors Please add @violetadev for code. |
|
I've put up a pull request to add @violetadev! 🎉 |




✨ Pull Request
📓 Referenced Issue
Fixes: #1258
ℹ️ About the PR
This PR reintroduces import/export capabilities in order to users to back up their settings and import them back.
🖼️ Testing Scenarios / Screenshots
respons.mp4