fix(curriculum): update test for lab currency converter (#66403)

This commit is contained in:
Aditya Singh
2026-03-14 15:59:12 +05:30
committed by GitHub
parent 1bfdfcb8cd
commit 2d75967c37
@@ -147,6 +147,16 @@ Changing the value of the first `select` element should display the new converte
```js
const s = await __helpers.prepTestComponent(window.index.CurrencyConverter);
const inp = s.querySelector('input[type="number"]');
assert.exists(inp);
await React.act(async () => {
inp.value = 10;
const ev = new Event("change", { bubbles: true, cancelable: false });
inp[Object.keys(inp).find((k) => k.startsWith("__reactProps"))]
.onChange({...ev, target: inp});
});
const nonFormContentBefore = getInnerTextExcept(s, "input,select");
const resultBefore = nonFormContentBefore.match(/(\d+\.\d{2})\s*([A-Z]{3})/);
@@ -172,6 +182,16 @@ Changing the value of the second `select` element should display the new convert
```js
const s = await __helpers.prepTestComponent(window.index.CurrencyConverter);
const inp = s.querySelector('input[type="number"]');
assert.exists(inp);
await React.act(async () => {
inp.value = 10;
const ev = new Event("change", { bubbles: true, cancelable: false });
inp[Object.keys(inp).find((k) => k.startsWith("__reactProps"))]
.onChange({...ev, target: inp});
});
const nonFormContentBefore = getInnerTextExcept(s, "input,select");
const resultBefore = nonFormContentBefore.match(/(\d+\.\d{2})\s*([A-Z]{3})/);