From 86cc7579452e5975567529a4c254445d51ace167 Mon Sep 17 00:00:00 2001 From: Shaun Hamilton Date: Tue, 7 Dec 2021 17:38:51 +0000 Subject: [PATCH] fix(client): remove normalize.css from globals (#44403) --- .../src/templates/Challenges/rechallenge/builders.js | 2 +- client/src/templates/Challenges/utils/build.js | 10 +--------- .../04-data-visualization/d3-dashboard/step-137.md | 7 +------ .../04-data-visualization/d3-dashboard/step-139.md | 9 +++------ .../04-data-visualization/d3-dashboard/step-140.md | 3 +-- .../04-data-visualization/d3-dashboard/step-142.md | 7 ++----- .../04-data-visualization/d3-dashboard/step-144.md | 9 ++++----- 7 files changed, 13 insertions(+), 34 deletions(-) diff --git a/client/src/templates/Challenges/rechallenge/builders.js b/client/src/templates/Challenges/rechallenge/builders.js index c8a97d1e11..38ad633ee0 100644 --- a/client/src/templates/Challenges/rechallenge/builders.js +++ b/client/src/templates/Challenges/rechallenge/builders.js @@ -91,7 +91,7 @@ A required file can not have both a src and a link: src = ${src}, link = ${link} } return ''; }) - .reduce((head, element) => head.concat(element)); + .reduce((head, element) => head.concat(element), []); const indexHtml = findIndexHtml(challengeFiles); diff --git a/client/src/templates/Challenges/utils/build.js b/client/src/templates/Challenges/utils/build.js index 31792bc9f0..832552697b 100644 --- a/client/src/templates/Challenges/utils/build.js +++ b/client/src/templates/Challenges/utils/build.js @@ -23,14 +23,6 @@ const frameRunner = [ } ]; -const globalRequires = [ - { - link: - 'https://cdnjs.cloudflare.com/' + - 'ajax/libs/normalize/4.2.0/normalize.min.css' - } -]; - const applyFunction = fn => async function (file) { try { @@ -142,7 +134,7 @@ export function buildDOMChallenge( { challengeFiles, required = [], template = '' }, { usesTestRunner } = { usesTestRunner: false } ) { - const finalRequires = [...globalRequires, ...required]; + const finalRequires = [...required]; if (usesTestRunner) finalRequires.push(...frameRunner); const loadEnzyme = challengeFiles.some( diff --git a/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-137.md b/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-137.md index 5c905cd713..a690b7567e 100644 --- a/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-137.md +++ b/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-137.md @@ -25,12 +25,7 @@ After this, you will be able to use `data[index]` to get that item in the array. test-text ```js -const script = $('.dashboard').siblings('script')[1].innerHTML; -assert( - /var index = data.findIndex\(function \(d\) \{\s*return (year === d\.year|d.year === year);\s*\}\);/g.test( - script - ) -); +assert.match(code,/const index = data.findIndex\(\(?d\)? => (year === d\.year|d.year === year)\s*\)/g); ``` # --seed-- diff --git a/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-139.md b/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-139.md index ae5f5717da..5630a5404b 100644 --- a/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-139.md +++ b/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-139.md @@ -20,12 +20,9 @@ So now, when you hover a label, the function will be called with the year that i test-text ```js -const script = $('.dashboard').siblings('script')[1].innerHTML; -assert( - /\.on\(('|"|`)mouseover\1, function \(d\) \{\s*return drawDashboard\(d\);\s*\}\)/g.test( - script - ) -); +assert.match(code, + /\.on\('mouseover', d => drawDashboard\(d\)\)/g + ); ``` # --seed-- diff --git a/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-140.md b/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-140.md index d08a07430d..45fd59a633 100644 --- a/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-140.md +++ b/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-140.md @@ -16,8 +16,7 @@ Go back to the top of the function and use `d3.select` to select the `.dashboard test-text ```js -const script = $('.dashboard').siblings('script')[1].innerHTML; -assert(/d3\.select\(('|"|`)\.dashboard\1\)\.html\(('|"|`)\2\)/g.test(script)); +assert.match(code, /d3\.select\(('|"|`)\.dashboard\1\)\.html\(('|"|`)\2\)/g); ``` # --seed-- diff --git a/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-142.md b/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-142.md index b7d124fcc7..bee3e7b598 100644 --- a/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-142.md +++ b/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-142.md @@ -14,11 +14,8 @@ Create another `mouseover` event for when you hover one of the `twitter-circles` test-text ```js -const script = $('.dashboard').siblings('script')[1].innerHTML; -assert( - /\.on\(('|"|`)mouseover\1, function \(d\) \{\s*return drawDashboard\(d\.year\);\s*\}\)/g.test( - script - ) +assert.match(code, + /\.on\('mouseover', d => drawDashboard\(d\.year\)\)/ ); ``` diff --git a/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-144.md b/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-144.md index 084a682013..97348bc5be 100644 --- a/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-144.md +++ b/curriculum/challenges/english/04-data-visualization/d3-dashboard/step-144.md @@ -16,11 +16,10 @@ After that, you will be able hover any of the circles or year labels to get the test-text ```js -const script = $('.dashboard').siblings('script')[1].innerHTML; -assert( - script.match( - /\.on\(('|"|`)mouseover\1, function \(d\) \{\s*return drawDashboard\(d\.year\);\s*\}\)/g - ).length === 3 +assert.equal( + code.match( + /\.on\('mouseover', d => drawDashboard\(d\.year\)\)/g + )?.length, 3 ); ```