From 2d75967c3770d4da2170ff057a50208b9abbbe18 Mon Sep 17 00:00:00 2001 From: Aditya Singh Date: Sat, 14 Mar 2026 15:59:12 +0530 Subject: [PATCH] fix(curriculum): update test for lab currency converter (#66403) --- .../67eaa957114d373deb3a9149.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/curriculum/challenges/english/blocks/lab-currency-converter/67eaa957114d373deb3a9149.md b/curriculum/challenges/english/blocks/lab-currency-converter/67eaa957114d373deb3a9149.md index 7bb7fedc973..ef94e6c4423 100644 --- a/curriculum/challenges/english/blocks/lab-currency-converter/67eaa957114d373deb3a9149.md +++ b/curriculum/challenges/english/blocks/lab-currency-converter/67eaa957114d373deb3a9149.md @@ -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})/);