kempo-ui 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/components/Aside.js
CHANGED
package/package.json
CHANGED
package/src/components/Aside.js
CHANGED
|
@@ -756,6 +756,41 @@ export default {
|
|
|
756
756
|
pass('AsideSpacer has flex-grow 1');
|
|
757
757
|
},
|
|
758
758
|
|
|
759
|
+
'AsideSpacer: aside should be a flex column so spacer pushes items down': async ({pass, fail}) => {
|
|
760
|
+
const aside = await createAside({ main: 'push', state: 'expanded' });
|
|
761
|
+
const item1 = document.createElement('k-aside-item');
|
|
762
|
+
item1.icon = 'cards';
|
|
763
|
+
item1.textContent = 'Top';
|
|
764
|
+
const spacer = document.createElement('k-aside-spacer');
|
|
765
|
+
const item2 = document.createElement('k-aside-item');
|
|
766
|
+
item2.icon = 'settings';
|
|
767
|
+
item2.textContent = 'Bottom';
|
|
768
|
+
aside.appendChild(item1);
|
|
769
|
+
aside.appendChild(spacer);
|
|
770
|
+
aside.appendChild(item2);
|
|
771
|
+
await item1.updateComplete;
|
|
772
|
+
await spacer.updateComplete;
|
|
773
|
+
await item2.updateComplete;
|
|
774
|
+
await new Promise(r => requestAnimationFrame(r));
|
|
775
|
+
const asideEl = aside.shadowRoot.querySelector('aside');
|
|
776
|
+
const asideStyle = getComputedStyle(asideEl);
|
|
777
|
+
if(asideStyle.display !== 'flex') {
|
|
778
|
+
cleanup(aside);
|
|
779
|
+
return fail(`Expected aside display flex, got ${asideStyle.display}`);
|
|
780
|
+
}
|
|
781
|
+
if(asideStyle.flexDirection !== 'column') {
|
|
782
|
+
cleanup(aside);
|
|
783
|
+
return fail(`Expected aside flex-direction column, got ${asideStyle.flexDirection}`);
|
|
784
|
+
}
|
|
785
|
+
const spacerRect = spacer.getBoundingClientRect();
|
|
786
|
+
if(spacerRect.height < 1) {
|
|
787
|
+
cleanup(aside);
|
|
788
|
+
return fail(`Spacer should have height > 0 to push items, got ${spacerRect.height}`);
|
|
789
|
+
}
|
|
790
|
+
cleanup(aside);
|
|
791
|
+
pass('Aside is a flex column and spacer pushes items down');
|
|
792
|
+
},
|
|
793
|
+
|
|
759
794
|
/*
|
|
760
795
|
Cleanup
|
|
761
796
|
*/
|