test improvements

This commit is contained in:
itsMapleLeaf
2022-04-23 01:54:52 -05:00
parent 1ba75492e5
commit 6851c5419a
3 changed files with 78 additions and 64 deletions

View File

@@ -55,7 +55,7 @@ describe("useInstance", () => {
await tester.assertMessages([messageOutput("parent")])
expect(instanceFromHook).toBe(instance)
tester.findButtonByLabel("create parent").click()
await tester.findButtonByLabel("create parent").click()
await tester.assertMessages([
messageOutput("parent"),
messageOutput("child"),
@@ -63,10 +63,10 @@ describe("useInstance", () => {
// this test ensures that the only the child instance is destroyed,
// and not the parent instance
tester.findButtonByLabel("destroy child").click()
await tester.findButtonByLabel("destroy child").click()
await tester.assertMessages([messageOutput("parent")])
tester.findButtonByLabel("destroy parent").click()
await tester.findButtonByLabel("destroy parent").click()
await tester.assertMessages([])
})
})