updated integration tests

This commit is contained in:
Marc Faber
2020-11-17 14:34:48 +01:00
parent e0ad5eaf5e
commit 06f74a8c15
9 changed files with 6 additions and 6 deletions

View File

@@ -101,7 +101,7 @@ describe('Flowchart v2', () => {
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
expect(maxWidthValue).to.be.within(300 * .95-1, 300 * 1.05);
expect(maxWidthValue).to.be.within(300 * .95-2, 300 * 1.05);
});
});
it('8: should render a flowchart when useMaxWidth is false', () => {
@@ -121,7 +121,7 @@ describe('Flowchart v2', () => {
const width = parseFloat(svg.attr('width'));
// use within because the absolute value can be slightly different depending on the environment ±5%
expect(height).to.be.within(446 * .95, 446 * 1.05);
expect(width).to.be.within(300 * .95-1, 300 * 1.05);
expect(width).to.be.within(300 * .95-2, 300 * 1.05);
expect(svg).to.not.have.attr('style');
});
});