feat(client): parse test 'text' as markdown (#39176)

This commit is contained in:
Oliver Eyton-Williams
2020-07-03 16:53:46 +02:00
committed by Mrugesh Mohapatra
parent f77005cc43
commit 0e1dca5924
3 changed files with 11 additions and 1 deletions

View File

@ -19,6 +19,10 @@
padding: 5px 10px; padding: 5px 10px;
} }
.test-output p {
margin: 0;
}
.test-status-icon { .test-status-icon {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -5,7 +5,7 @@ Object {
"tests": Array [ "tests": Array [
Object { Object {
"testString": "assert.isTrue((/hello(\\\\s)+world/gi).test($('h1').text()), 'Your <code>h1</code> element should have the text \\"Hello World\\".');", "testString": "assert.isTrue((/hello(\\\\s)+world/gi).test($('h1').text()), 'Your <code>h1</code> element should have the text \\"Hello World\\".');",
"text": "Your <code>h1</code> element should have the text \\"Hello World\\".", "text": "<p>Your <code>h1</code> element should have the text \\"Hello World\\".</p>",
}, },
], ],
} }

View File

@ -34,6 +34,12 @@ function plugin() {
); );
tests.question.text = mdToHTML(tests.question.text); tests.question.text = mdToHTML(tests.question.text);
} }
if (tests.tests) {
tests.tests = tests.tests.map(({ text, testString }) => ({
text: mdToHTML(text),
testString
}));
}
file.data = { file.data = {
...file.data, ...file.data,
...tests ...tests