Improve tests
This commit is contained in:
parent
a33e4bbcb9
commit
20e1c3f22d
28 changed files with 115 additions and 56 deletions
|
|
@ -0,0 +1,47 @@
|
|||
import type { AssertableState } from "../utils/assertable-state";
|
||||
import type { TestDefinition } from "../test-definition";
|
||||
|
||||
export const userParenthesizedFileNotDeletedTest: TestDefinition = {
|
||||
description:
|
||||
"A user-created file named 'Chapter (1).bin' alongside 'Chapter.bin' should not " +
|
||||
"be mistakenly removed when another client creates a conflicting file.",
|
||||
clients: 2,
|
||||
steps: [
|
||||
{ type: "enable-sync", client: 0 },
|
||||
|
||||
{
|
||||
type: "create",
|
||||
client: 0,
|
||||
path: "Chapter.bin",
|
||||
content: "chapter one"
|
||||
},
|
||||
{
|
||||
type: "create",
|
||||
client: 0,
|
||||
path: "Chapter (1).bin",
|
||||
content: "chapter one notes"
|
||||
},
|
||||
|
||||
{ type: "sync", client: 0 },
|
||||
|
||||
{
|
||||
type: "create",
|
||||
client: 1,
|
||||
path: "Chapter.bin",
|
||||
content: "chapter one notes"
|
||||
},
|
||||
{ type: "enable-sync", client: 1 },
|
||||
{ type: "barrier" },
|
||||
|
||||
{
|
||||
type: "assert-consistent",
|
||||
verify: (state: AssertableState): void => {
|
||||
state
|
||||
.assertFileCount(3)
|
||||
.assertFileExists("Chapter.bin")
|
||||
.assertFileExists("Chapter (1).bin")
|
||||
.assertFileExists("Chapter (2).bin");
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue