Skip to content

Commit 12db2e8

Browse files
committed
Reorder steps based on Puppeteer Replay types
1 parent 8debc09 commit 12db2e8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ export class Extension implements StringifyExtension {
4949
`userEvent.click(${stringifySelector(step.selectors[0])}")`,
5050
)
5151
break
52-
case "waitForElement":
53-
out.appendLine(
54-
`await waitFor(() => ${stringifySelector(step.selectors[0])})`,
55-
)
56-
break
5752
case "navigate":
5853
if (step === flow.steps.find((step) => step.type === "navigate")) {
5954
for (const { url, title } of step.assertedEvents ?? []) {
@@ -70,6 +65,11 @@ export class Extension implements StringifyExtension {
7065
)
7166
}
7267
break
68+
case "waitForElement":
69+
out.appendLine(
70+
`await waitFor(() => ${stringifySelector(step.selectors[0])})`,
71+
)
72+
break
7373
default:
7474
console.log(
7575
`Warning: Testing Library does not currently handle migrating steps of type: ${step.type}. Please check the output to see how this might affect your test.`,

0 commit comments

Comments
 (0)