Replace regex with contain match

This commit is contained in:
Ian Sanders 2024-05-14 15:02:14 -04:00
parent df94d3994d
commit 3b2b8dacd8
No known key found for this signature in database
GPG Key ID: 9D55FF9535DB8FC3

View File

@ -203,12 +203,10 @@ describe('mermaidAPI', () => {
const base64encodedSrc = toBase64(
'<body style="' + 'margin:0' + '">' + inputSvgCode + '</body>'
);
const expectedRegExp = new RegExp(
'src="data:text/html;charset=UTF-8;base64,' + base64encodedSrc + '"'
);
const expectedSrc = 'src="data:text/html;charset=UTF-8;base64,' + base64encodedSrc + '"'
const result = putIntoIFrame(inputSvgCode);
expect(result).toMatch(expectedRegExp);
expect(result).toContain(expectedSrc);
});
it('uses the height and appends px from the svgElement given', () => {