Updated test
This commit is contained in:
parent
75769c46de
commit
560951d597
|
@ -358,7 +358,7 @@ describe('State diagram', () => {
|
||||||
expect(svg).to.have.attr('width', '100%');
|
expect(svg).to.have.attr('width', '100%');
|
||||||
expect(svg).to.have.attr('height');
|
expect(svg).to.have.attr('height');
|
||||||
const height = parseFloat(svg.attr('height'));
|
const height = parseFloat(svg.attr('height'));
|
||||||
expect(height).to.eq(171);
|
expect(height).to.be.within(139,141);
|
||||||
const style = svg.attr('style');
|
const style = svg.attr('style');
|
||||||
expect(style).to.match(/^max-width: [\d.]+px;$/);
|
expect(style).to.match(/^max-width: [\d.]+px;$/);
|
||||||
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
|
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
|
||||||
|
@ -379,7 +379,7 @@ describe('State diagram', () => {
|
||||||
.should((svg) => {
|
.should((svg) => {
|
||||||
const height = parseFloat(svg.attr('height'));
|
const height = parseFloat(svg.attr('height'));
|
||||||
const width = parseFloat(svg.attr('width'));
|
const width = parseFloat(svg.attr('width'));
|
||||||
expect(height).to.eq(171);
|
expect(height).to.be.within(139,141);
|
||||||
// use within because the absolute value can be slightly different depending on the environment ±5%
|
// use within because the absolute value can be slightly different depending on the environment ±5%
|
||||||
expect(width).to.be.within(112 * .95, 112 * 1.05);
|
expect(width).to.be.within(112 * .95, 112 * 1.05);
|
||||||
expect(svg).to.not.have.attr('style');
|
expect(svg).to.not.have.attr('style');
|
||||||
|
|
Loading…
Reference in New Issue