describe( ‘a-space-children-vertical’, () => { const parent = document.querySelector( ‘.a-space-children-vertical’ ); const parentBox = parent.getBoundingClientRect(); it( ‘does not apply a space above the first item’, () => { let kidBox = parent.children[0].getBoundingClientRect(); return assertEquals( parentBox.top, kidBox.top ); });
it( ‘spaces children’, () => { let kid1Box = parent.children[0].getBoundingClientRect(); let kid2Box = parent.children[1].getBoundingClientRect(); let parentStyles = window.getComputedStyle( parent ); let spaceBetweenKids = parseInt( parentStyles.getPropertyValue( ‘—a-space-children-space return assertEquals( kid1Box.bottom, ( kid2Box.top - spaceBetweenKids ) ); }); it( ‘does not apply a space below the last item’, () => { let kidBox = children[ children.length - 1 ];