fix(curriculum): make step 3 state tests order-agnostic (#65516)

This commit is contained in:
Fernando Belmonte Archetti 2026-03-02 05:48:44 -03:00 committed by GitHub
parent 42beead4f7
commit 49a1e72e05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,7 +38,8 @@ Your `useState` hook for `powerSource` should have an initial value of empty str
const _a = eval(script);
const _b = await __helpers.prepTestComponent(exports.SuperheroForm);
assert.strictEqual(abuseState.calls[2]?.[0], "");
const newStateCalls = abuseState.calls.slice(2);
assert.isTrue(newStateCalls.some(call => call[0] === ""));
```
You should use array destructuring to set a `powers` state variable and a `setPowers` setter.
@ -68,9 +69,8 @@ Your `useState` hook for `powers` should have an initial value of empty array.
const _a = eval(script);
const _b = await __helpers.prepTestComponent(exports.SuperheroForm);
console.log("State calls:", abuseState.calls)
assert.deepEqual(abuseState.calls[3]?.[0], []);
const newStateCalls = abuseState.calls.slice(2);
assert.isTrue(newStateCalls.some(call => Array.isArray(call[0]) && call[0].length === 0));
```
# --seed--