-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into improve-exe-test-file
- Loading branch information
Showing
10 changed files
with
85 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { joinPath } from "../globals"; | ||
import { conversionSaveFolderPath, guidedProgressFilePath, stubSaveFolderPath } from "../dependencies/simple"; | ||
import { fs } from "../electron"; | ||
|
||
export const remove = (name) => { | ||
//Get the path of the progress file to delete | ||
const progressFilePathToDelete = joinPath(guidedProgressFilePath, name + ".json"); | ||
|
||
//delete the progress file | ||
if (fs) fs.unlinkSync(progressFilePathToDelete); | ||
else localStorage.removeItem(progressFilePathToDelete); | ||
|
||
if (fs) { | ||
// delete default stub location | ||
fs.rmSync(joinPath(stubSaveFolderPath, name), { recursive: true, force: true }); | ||
|
||
// delete default conversion location | ||
fs.rmSync(joinPath(conversionSaveFolderPath, name), { recursive: true, force: true }); | ||
} | ||
|
||
return true; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
import { test } from 'vitest' | ||
import { updateAppProgress } from '../src/renderer/src/progress/update' | ||
import { expect, test } from 'vitest' | ||
import { updateAppProgress, updateFile, rename } from '../src/renderer/src/progress/update' | ||
import { get } from '../src/renderer/src/progress' | ||
import { remove } from '../src/renderer/src/progress/operations' | ||
|
||
test('updates to app progress do not fail', () => updateAppProgress('/', {})) | ||
|
||
const initialName = '.progressTestPipelineName' | ||
const renameName = initialName + 2 | ||
const info = { random: Math.random() } | ||
|
||
// Remove before tests | ||
remove(initialName) | ||
remove(renameName) | ||
|
||
// create pipeline | ||
test('pipeline creation works', () => { | ||
updateFile(initialName, () => info) | ||
const result = get(initialName) | ||
expect(result.random).toEqual(info.random) // NOTE: Result has an extra lastModified field | ||
}) | ||
|
||
// rename pipeline | ||
test('pipeline renaming works', () => rename(renameName, initialName)) | ||
|
||
// delete pipeline | ||
test('pipeline deletion works', () => remove(renameName)) |