From f6a4c486368e3ef0c595f994e0627f4acfdb3473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giftea=20=E2=98=95?= Date: Wed, 15 Oct 2025 23:11:54 +0100 Subject: [PATCH] fix(curriculum): add .trim() to innerText and textContent assertions (#62810) --- .../workshop-balance-sheet/61fd67a656743144844941cb.md | 4 ++-- .../workshop-balance-sheet/61fd6b7c83dbf54a08cf0498.md | 6 +++--- .../workshop-balance-sheet/61fd75ea7f663457612dba02.md | 8 ++++---- .../workshop-balance-sheet/61fd778081276b59d59abad6.md | 10 +++++----- .../workshop-balance-sheet/61fd77f7ad2aeb5ae34d07d6.md | 10 +++++----- .../workshop-balance-sheet/61fd78621573aa5e8b512f5e.md | 10 +++++----- .../workshop-balance-sheet/61fd8fd08af43372f02952d0.md | 8 ++++---- .../workshop-balance-sheet/61fd933ba685de776a94997e.md | 10 +++++----- .../workshop-balance-sheet/61fd94056e0355785fbba4d3.md | 10 +++++----- .../workshop-balance-sheet/61fd986ddbcbd47ba8fbc5ec.md | 10 +++++----- .../workshop-balance-sheet/61fd990577d8227dd93fbeeb.md | 10 +++++----- .../workshop-balance-sheet/61fd9ad665a4a282c8106be3.md | 8 ++++---- .../workshop-balance-sheet/61fd9b7285bde783ad5b8aac.md | 10 +++++----- 13 files changed, 57 insertions(+), 57 deletions(-) diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd67a656743144844941cb.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd67a656743144844941cb.md index 027048c2587..76a62feb323 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd67a656743144844941cb.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd67a656743144844941cb.md @@ -45,7 +45,7 @@ Your first new `span` element should have the text `AcmeWidgetCorp`. ```js assert.strictEqual( - document.querySelector('.flex')?.children?.[0]?.textContent, + document.querySelector('.flex')?.children?.[0]?.textContent.trim(), 'AcmeWidgetCorp' ); ``` @@ -54,7 +54,7 @@ Your second new `span` element should have the text `Balance Sheet`. ```js assert.strictEqual( - document.querySelector('.flex')?.children?.[1]?.textContent, + document.querySelector('.flex')?.children?.[1]?.textContent.trim(), 'Balance Sheet' ); ``` diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd6b7c83dbf54a08cf0498.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd6b7c83dbf54a08cf0498.md index f49e38e94b2..20ef297cfa8 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd6b7c83dbf54a08cf0498.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd6b7c83dbf54a08cf0498.md @@ -28,7 +28,7 @@ Your first `span` should have the text `2019`. ```js assert.strictEqual( - document.querySelector('div')?.children?.[0]?.textContent, + document.querySelector('div')?.children?.[0]?.textContent.trim(), '2019' ); ``` @@ -37,7 +37,7 @@ Your second `span` should have the text `2020`. ```js assert.strictEqual( - document.querySelector('div')?.children?.[1]?.textContent, + document.querySelector('div')?.children?.[1]?.textContent.trim(), '2020' ); ``` @@ -46,7 +46,7 @@ Your third `span` should have the text `2021`. ```js assert.strictEqual( - document.querySelector('div')?.children?.[2]?.textContent, + document.querySelector('div')?.children?.[2]?.textContent.trim(), '2021' ); ``` diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd75ea7f663457612dba02.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd75ea7f663457612dba02.md index 55be22c57c2..fd25d7233ae 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd75ea7f663457612dba02.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd75ea7f663457612dba02.md @@ -39,7 +39,7 @@ Your first `span` element should have the text `2019`. ```js assert.strictEqual( - document.querySelectorAll('th')?.[0]?.children?.[0]?.textContent, + document.querySelectorAll('th')?.[0]?.children?.[0]?.textContent.trim(), '2019' ); ``` @@ -48,7 +48,7 @@ Your second `span` element should have the text `2020`. ```js assert.strictEqual( - document.querySelectorAll('th')?.[1]?.children?.[0]?.textContent, + document.querySelectorAll('th')?.[1]?.children?.[0]?.textContent.trim(), '2020' ); ``` @@ -57,7 +57,7 @@ Your third `span` element should have the text `2021`. ```js assert.strictEqual( - document.querySelectorAll('th')?.[2]?.children?.[0]?.textContent, + document.querySelectorAll('th')?.[2]?.children?.[0]?.textContent.trim(), '2021' ); ``` @@ -78,7 +78,7 @@ Your `td` element should be empty. ```js const table = document.querySelector('table'); const tableData = table.querySelectorAll('td')?.[0]; -assert.strictEqual(tableData?.textContent, ''); +assert.strictEqual(tableData?.textContent.trim(), ''); assert.isEmpty(tableData?.children); ``` diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd778081276b59d59abad6.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd778081276b59d59abad6.md index c02615cbb39..3b7f2349026 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd778081276b59d59abad6.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd778081276b59d59abad6.md @@ -27,7 +27,7 @@ Your `th` element should have the text `Cash This is the cash we currently have const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[0]; assert.strictEqual( - tableRow?.querySelector('th')?.innerText, + tableRow?.querySelector('th')?.innerText.trim(), 'Cash This is the cash we currently have on hand.' ); ``` @@ -38,7 +38,7 @@ You should wrap the text `This is the cash we currently have on hand.` in a `spa const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[0]; assert.strictEqual( - tableRow?.querySelector('th > span')?.textContent, + tableRow?.querySelector('th > span')?.textContent.trim(), 'This is the cash we currently have on hand.' ); ``` @@ -66,7 +66,7 @@ Your first `td` element should have the text `$25`. ```js const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[0]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent, '$25'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent.trim(), '$25'); ``` Your second `td` element should have the text `$30`. @@ -74,7 +74,7 @@ Your second `td` element should have the text `$30`. ```js const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[0]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent, '$30'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent.trim(), '$30'); ``` Your third `td` element should have the text `$28`. @@ -82,7 +82,7 @@ Your third `td` element should have the text `$28`. ```js const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[0]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent, '$28'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent.trim(), '$28'); ``` Your third `td` element should have the `class` set to `current`. diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd77f7ad2aeb5ae34d07d6.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd77f7ad2aeb5ae34d07d6.md index 2bf07f09806..6f35ab4d23b 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd77f7ad2aeb5ae34d07d6.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd77f7ad2aeb5ae34d07d6.md @@ -27,7 +27,7 @@ Your `th` element should have the text `Checking Our primary transactional accou const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[1]; assert.strictEqual( - tableRow?.querySelector('th')?.innerText, + tableRow?.querySelector('th')?.innerText.trim(), 'Checking Our primary transactional account.' ); ``` @@ -38,7 +38,7 @@ You should wrap the text `Our primary transactional account.` in a `span` elemen const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[1]; assert.strictEqual( - tableRow?.querySelector('th > span')?.textContent, + tableRow?.querySelector('th > span')?.textContent.trim(), 'Our primary transactional account.' ); ``` @@ -66,7 +66,7 @@ Your first `td` element should have the text `$54`. ```js const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[1]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent, '$54'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent.trim(), '$54'); ``` Your second `td` element should have the text `$56`. @@ -74,7 +74,7 @@ Your second `td` element should have the text `$56`. ```js const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[1]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent, '$56'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent.trim(), '$56'); ``` Your third `td` element should have the text `$53`. @@ -82,7 +82,7 @@ Your third `td` element should have the text `$53`. ```js const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[1]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent, '$53'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent.trim(), '$53'); ``` Your third `td` element should have the `class` set to `current`. diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd78621573aa5e8b512f5e.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd78621573aa5e8b512f5e.md index cd58cd5af74..0ed6845db80 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd78621573aa5e8b512f5e.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd78621573aa5e8b512f5e.md @@ -27,7 +27,7 @@ Your `th` element should have the text `Savings Funds set aside for emergencies. const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[2]; assert.strictEqual( - tableRow?.querySelector('th')?.innerText, + tableRow?.querySelector('th')?.innerText.trim(), 'Savings Funds set aside for emergencies.' ); ``` @@ -38,7 +38,7 @@ You should wrap the text `Funds set aside for emergencies.` in a `span` element. const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[2]; assert.strictEqual( - tableRow?.querySelector('th > span')?.textContent, + tableRow?.querySelector('th > span')?.textContent.trim(), 'Funds set aside for emergencies.' ); ``` @@ -66,7 +66,7 @@ Your first `td` element should have the text `$500`. ```js const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[2]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent, '$500'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent.trim(), '$500'); ``` Your second `td` element should have the text `$650`. @@ -74,7 +74,7 @@ Your second `td` element should have the text `$650`. ```js const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[2]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent, '$650'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent.trim(), '$650'); ``` Your third `td` element should have the text `$728`. @@ -82,7 +82,7 @@ Your third `td` element should have the text `$728`. ```js const tableBody = document.querySelector('tbody'); const tableRow = tableBody?.querySelectorAll('tr')?.[2]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent, '$728'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent.trim(), '$728'); ``` Your third `td` element should have the `class` set to `current`. diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd8fd08af43372f02952d0.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd8fd08af43372f02952d0.md index 368f04e5e16..5bf1ba24565 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd8fd08af43372f02952d0.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd8fd08af43372f02952d0.md @@ -39,7 +39,7 @@ Your first `span` element should have the text `2019`. ```js const table = document.querySelectorAll('table')?.[1]; const th = table.querySelectorAll('th')?.[0]; -assert.strictEqual(th.children?.[0]?.textContent, '2019'); +assert.strictEqual(th.children?.[0]?.textContent.trim(), '2019'); ``` Your second `span` element should have the text `2020`. @@ -47,7 +47,7 @@ Your second `span` element should have the text `2020`. ```js const table = document.querySelectorAll('table')?.[1]; const th = table.querySelectorAll('th')?.[1]; -assert.strictEqual(th?.children?.[0]?.textContent, '2020'); +assert.strictEqual(th?.children?.[0]?.textContent.trim(), '2020'); ``` Your third `span` element should have the text `2021`. @@ -55,7 +55,7 @@ Your third `span` element should have the text `2021`. ```js const table = document.querySelectorAll('table')?.[1]; const th = table.querySelectorAll('th')?.[2]; -assert.strictEqual(th?.children?.[0]?.textContent, '2021'); +assert.strictEqual(th?.children?.[0]?.textContent.trim(), '2021'); ``` Your `td` element should be empty. @@ -63,7 +63,7 @@ Your `td` element should be empty. ```js const table = document.querySelectorAll('table')?.[1]; const td = table.querySelectorAll('td')?.[0]; -assert.strictEqual(td?.textContent, ''); +assert.strictEqual(td?.textContent.trim(), ''); assert.lengthOf(td?.children, 0); ``` diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd933ba685de776a94997e.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd933ba685de776a94997e.md index 933017853f5..304c6bc4c9f 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd933ba685de776a94997e.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd933ba685de776a94997e.md @@ -29,7 +29,7 @@ const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[0]; assert.strictEqual( - tableRow?.querySelector('th')?.innerText, + tableRow?.querySelector('th')?.innerText.trim(), 'Loans The outstanding balance on our startup loan.' ); ``` @@ -41,7 +41,7 @@ const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[0]; assert.strictEqual( - tableRow?.querySelector('th > span')?.textContent, + tableRow?.querySelector('th > span')?.textContent.trim(), 'The outstanding balance on our startup loan.' ); ``` @@ -72,7 +72,7 @@ Your first `td` element should have the text `$500`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[0]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent, '$500'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent.trim(), '$500'); ``` Your second `td` element should have the text `$250`. @@ -81,7 +81,7 @@ Your second `td` element should have the text `$250`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[0]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent, '$250'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent.trim(), '$250'); ``` Your third `td` element should have the text `$0`. @@ -90,7 +90,7 @@ Your third `td` element should have the text `$0`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[0]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent, '$0'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent.trim(), '$0'); ``` Your third `td` element should have the `class` set to `current`. diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd94056e0355785fbba4d3.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd94056e0355785fbba4d3.md index df993b05d9c..95a30ad1ae6 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd94056e0355785fbba4d3.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd94056e0355785fbba4d3.md @@ -29,7 +29,7 @@ const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[1]; assert.strictEqual( - tableRow?.querySelector('th')?.innerText, + tableRow?.querySelector('th')?.innerText.trim(), 'Expenses Annual anticipated expenses, such as payroll.' ); ``` @@ -41,7 +41,7 @@ const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[1]; assert.strictEqual( - tableRow?.querySelector('th > span')?.textContent, + tableRow?.querySelector('th > span')?.textContent.trim(), 'Annual anticipated expenses, such as payroll.' ); ``` @@ -72,7 +72,7 @@ Your first `td` element should have the text `$200`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[1]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent, '$200'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent.trim(), '$200'); ``` Your second `td` element should have the text `$300`. @@ -81,7 +81,7 @@ Your second `td` element should have the text `$300`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[1]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent, '$300'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent.trim(), '$300'); ``` Your third `td` element should have the text `$400`. @@ -90,7 +90,7 @@ Your third `td` element should have the text `$400`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[1]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent, '$400'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent.trim(), '$400'); ``` Your third `td` element should have the `class` set to `current`. diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd986ddbcbd47ba8fbc5ec.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd986ddbcbd47ba8fbc5ec.md index 9615e0b00d5..13ca6c1bfa4 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd986ddbcbd47ba8fbc5ec.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd986ddbcbd47ba8fbc5ec.md @@ -29,7 +29,7 @@ const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[2]; assert.strictEqual( - tableRow?.querySelector('th')?.innerText, + tableRow?.querySelector('th')?.innerText.trim(), 'Credit The outstanding balance on our credit card.' ); ``` @@ -41,7 +41,7 @@ const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[2]; assert.strictEqual( - tableRow?.querySelector('th > span')?.textContent, + tableRow?.querySelector('th > span')?.textContent.trim(), 'The outstanding balance on our credit card.' ); ``` @@ -72,7 +72,7 @@ Your first `td` element should have the text `$50`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[2]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent, '$50'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent.trim(), '$50'); ``` Your second `td` element should have the text `$50`. @@ -81,7 +81,7 @@ Your second `td` element should have the text `$50`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[2]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent, '$50'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent.trim(), '$50'); ``` Your third `td` element should have the text `$75`. @@ -90,7 +90,7 @@ Your third `td` element should have the text `$75`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[2]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent, '$75'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent.trim(), '$75'); ``` Your third `td` element should have the `class` set to `current`. diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd990577d8227dd93fbeeb.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd990577d8227dd93fbeeb.md index a1634c2c06a..470162adbda 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd990577d8227dd93fbeeb.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd990577d8227dd93fbeeb.md @@ -29,7 +29,7 @@ const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[3]; assert.strictEqual( - tableRow?.querySelector('th')?.innerText, + tableRow?.querySelector('th')?.innerText.trim(), 'Total Liabilities' ); ``` @@ -41,7 +41,7 @@ const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[3]; assert.strictEqual( - tableRow?.querySelector('th > span')?.textContent, + tableRow?.querySelector('th > span')?.textContent.trim(), 'Liabilities' ); ``` @@ -72,7 +72,7 @@ Your first `td` element should have the text `$750`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[3]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent, '$750'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent.trim(), '$750'); ``` Your second `td` element should have the text `$600`. @@ -81,7 +81,7 @@ Your second `td` element should have the text `$600`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[3]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent, '$600'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent.trim(), '$600'); ``` Your third `td` element should have the text `$475`. @@ -90,7 +90,7 @@ Your third `td` element should have the text `$475`. const table = document.querySelectorAll('table')?.[1]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[3]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent, '$475'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent.trim(), '$475'); ``` Your third `td` element should have the `class` set to `current`. diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd9ad665a4a282c8106be3.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd9ad665a4a282c8106be3.md index c28be7b4eb5..309601bf7df 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd9ad665a4a282c8106be3.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd9ad665a4a282c8106be3.md @@ -66,7 +66,7 @@ Your first `span` element should have the text `2019`. ```js const table = document.querySelectorAll('table')?.[2]; const thead = table.querySelectorAll('th')?.[0]; -assert.strictEqual(thead?.children?.[0]?.textContent, '2019'); +assert.strictEqual(thead?.children?.[0]?.textContent.trim(), '2019'); ``` Your second `span` element should have the text `2020`. @@ -74,7 +74,7 @@ Your second `span` element should have the text `2020`. ```js const table = document.querySelectorAll('table')?.[2]; const thead = table.querySelectorAll('th')?.[1]; -assert.strictEqual(thead?.children?.[0]?.textContent, '2020'); +assert.strictEqual(thead?.children?.[0]?.textContent.trim(), '2020'); ``` Your third `span` element should have the text `2021`. @@ -82,7 +82,7 @@ Your third `span` element should have the text `2021`. ```js const table = document.querySelectorAll('table')?.[2]; const thead = table.querySelectorAll('th')?.[2]; -assert.strictEqual(thead?.children?.[0]?.textContent, '2021'); +assert.strictEqual(thead?.children?.[0]?.textContent.trim(), '2021'); ``` Your `td` element should be empty. @@ -90,7 +90,7 @@ Your `td` element should be empty. ```js const table = document.querySelectorAll('table')?.[2]; const tableData = table?.querySelectorAll('td')?.[0]; -assert.strictEqual(tableData?.textContent, ''); +assert.strictEqual(tableData?.textContent.trim(), ''); assert.isTrue(tableData?.children?.length === 0); ``` diff --git a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd9b7285bde783ad5b8aac.md b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd9b7285bde783ad5b8aac.md index aebc90b4e1e..f80bd053967 100644 --- a/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd9b7285bde783ad5b8aac.md +++ b/curriculum/challenges/english/blocks/workshop-balance-sheet/61fd9b7285bde783ad5b8aac.md @@ -44,7 +44,7 @@ Your `th` element should have the text `Total Net Worth`. const table = document.querySelectorAll('table')?.[2]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[0]; -assert.strictEqual(tableRow?.querySelector('th')?.innerText, 'Total Net Worth'); +assert.strictEqual(tableRow?.querySelector('th')?.innerText.trim(), 'Total Net Worth'); ``` You should wrap the text `Net Worth` in a `span` element. @@ -54,7 +54,7 @@ const table = document.querySelectorAll('table')?.[2]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[0]; assert.strictEqual( - tableRow?.querySelector('th > span')?.textContent, + tableRow?.querySelector('th > span')?.textContent.trim(), 'Net Worth' ); ``` @@ -85,7 +85,7 @@ Your first `td` element should have the text `$-171`. const table = document.querySelectorAll('table')?.[2]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[0]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent, '$-171'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[0]?.textContent.trim(), '$-171'); ``` Your second `td` element should have the text `$136`. @@ -94,7 +94,7 @@ Your second `td` element should have the text `$136`. const table = document.querySelectorAll('table')?.[2]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[0]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent, '$136'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[1]?.textContent.trim(), '$136'); ``` Your third `td` element should have the text `$334`. @@ -103,7 +103,7 @@ Your third `td` element should have the text `$334`. const table = document.querySelectorAll('table')?.[2]; const tbody = table?.querySelector('tbody'); const tableRow = tbody?.querySelectorAll('tr')?.[0]; -assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent, '$334'); +assert.strictEqual(tableRow?.querySelectorAll('td')?.[2]?.textContent.trim(), '$334'); ``` Your third `td` element should have the `class` set to `current`.