Skip to content

Commit 2838382

Browse files
authored
fix(curriculum): improve tests in markdown converter lab (freeCodeCamp#61899)
1 parent 2ecd008 commit 2838382

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

curriculum/challenges/english/25-front-end-development/lab-markdown-to-html-converter/66f55eac933ff64ce654ca74.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ const testDiv = document.createElement("div");
134134
testDiv.innerHTML = convertMarkdown();
135135
const testH1 = testDiv.querySelector("h1")
136136
assert.notExists(testH1);
137+
assert.equal(testDiv.innerText, input.value)
137138
```
138139

139140
When the value of `#markdown-input` is `# title 1` followed by `# alternate title` on a new line, `convertMarkdown()` should return `<h1>title 1</h1><h1>alternate title</h1>`.
@@ -202,6 +203,7 @@ const testDiv = document.createElement("div");
202203
testDiv.innerHTML = convertMarkdown();
203204
const testH2 = testDiv.querySelector("h2")
204205
assert.notExists(testH2);
206+
assert.equal(testDiv.innerText, input.value)
205207
```
206208

207209
When the value of `#markdown-input` is `## title 2` followed by `## title 2 alt` on a new line, `convertMarkdown()` should return `<h2>title 2</h2><h2>title 2 alt</h2>`.
@@ -270,6 +272,7 @@ const testDiv = document.createElement("div");
270272
testDiv.innerHTML = convertMarkdown();
271273
const testH3 = testDiv.querySelector("h3")
272274
assert.notExists(testH3);
275+
assert.equal(testDiv.innerText, input.value)
273276
```
274277

275278
When the value of `#markdown-input` is `### title 3` followed by `### third title` on a new line, `convertMarkdown()` should return `<h3>title 3</h3><h3>third title</h3>`.
@@ -779,6 +782,7 @@ const testDiv = document.createElement("div");
779782
testDiv.innerHTML = convertMarkdown();
780783
const testQuote = testDiv.querySelector("blockquote")
781784
assert.notExists(testQuote);
785+
assert.equal(testDiv.innerText, input.value)
782786
```
783787

784788
When the value of `#markdown-input` is `> **this is a *quote***`, `convertMarkdown()` should return `<blockquote><strong>this is a <em>quote</em></strong></blockquote>`.

0 commit comments

Comments
 (0)