Skip to content

Commit

Permalink
Fix backend tests to resolve the error No H1 tag detected
Browse files Browse the repository at this point in the history
  • Loading branch information
yacchin1205 committed May 26, 2024
1 parent d101e33 commit 0d31169
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions static/tests/backend/specs/exportHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ describe('ep_headings2 - export headings to HTML', function () {
.set("Authorization", await generateJWTToken());
const html = res.body.data.html;
console.warn('HTML', html);
if (html.indexOf('<h1 style=\'text-align:left\'>Hello world</h1>') === -1) {
if (html.search(/<h1 +style='text-align:left'>Hello world<\/h1>/) === -1) {
throw new Error('No H1 tag detected');
}
if (html.indexOf('<h2 style=\'text-align:center\'>Foo</h2>') === -1) {
if (html.search(/<h2 +style='text-align:center'>Foo<\/h2>/) === -1) {
throw new Error('No H2 tag detected');
}
} catch (e) {
Expand Down

0 comments on commit 0d31169

Please sign in to comment.