Merge pull request #2312 from cm-wada-yusuke/bug/2160-fixed-height-useMaxWith

configureSvgSize should make height 100% when useMaxWidth is true.
This commit is contained in:
Knut Sveidqvist
2021-09-23 19:32:43 +02:00
committed by GitHub
10 changed files with 12 additions and 28 deletions

View File

@@ -635,9 +635,7 @@ context('Sequence diagram', () => {
cy.get('svg')
.should((svg) => {
expect(svg).to.have.attr('width', '100%');
expect(svg).to.have.attr('height');
const height = parseFloat(svg.attr('height'));
expect(height).to.be.within(920, 960);
expect(svg).to.have.attr('height', '100%');
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));