MCPcopy Index your code
hub / github.com/angular-split/angular-split / checkSplitDirAndSizes

Function checkSplitDirAndSizes

cypress/support/splitUtils.js:60–91  ·  view source on GitHub ↗
(el, dir, w, h, gutterOrGutters, sizes)

Source from the content-addressed store, hash-verified

58//////////////////////////////////////////
59
60export function checkSplitDirAndSizes(el, dir, w, h, gutterOrGutters, sizes) {
61 const gutters = Array.isArray(gutterOrGutters) ? gutterOrGutters : new Array(sizes.length - 1).fill(gutterOrGutters)
62
63 cy.log(`-- NEW SPLIT CHECK (${dir},${w},${h},[${gutters.join(',')}],[${sizes.join(',')}])`)
64
65 const propGridDir = dir === 'vertical' ? 'grid-template-rows' : 'grid-template-columns'
66 cy.get(el).should('have.css', propGridDir).should('include', ' ')
67
68 const propSize = dir === 'horizontal' ? 'width' : 'height'
69 const propSize2 = propSize === 'width' ? 'height' : 'width'
70 const propValue2 = propSize === 'width' ? h : w
71
72 const round = (value) => Math.round(value * 10) / 10
73
74 cy.get(`${el} > .as-split-gutter`).should('have.length', sizes.length - 1)
75
76 cy.get(`${el} > .as-split-gutter`).each(($el, index) => {
77 const rect = $el[0].getBoundingClientRect()
78
79 expect(rect[propSize]).to.be.eq(gutters[index])
80 expect(round(rect[propSize2])).to.be.eq(round(propValue2))
81 })
82
83 cy.get(`${el} > .as-split-area`)
84 .should('have.length', sizes.length)
85 .each(($li, index) => {
86 const rect = $li[0].getBoundingClientRect()
87
88 expect(round(rect[propSize])).to.be.eq(round(sizes[index]))
89 expect(round(rect[propSize2])).to.be.eq(round(propValue2))
90 })
91}

Callers 8

4.sync.cy.jsFile · 0.90
10.toggle.cy.jsFile · 0.90
7.click.cy.jsFile · 0.90
3.nested.cy.jsFile · 0.90
5.style.cy.jsFile · 0.90
9.geek.cy.jsFile · 0.90
1.simple.cy.jsFile · 0.90
2.minmax.cy.jsFile · 0.90

Calls 2

roundFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…