@@ -4,7 +4,7 @@ import sinon from 'sinon';
44import '../src/vaadin-notification.js' ;
55
66describe ( 'multiple notification' , ( ) => {
7- let wrapper , notifications , container , regions ;
7+ let wrapper , notifications , container ;
88
99 beforeEach ( async ( ) => {
1010 wrapper = fixtureSync ( `
@@ -38,8 +38,6 @@ describe('multiple notification', () => {
3838 } ) ;
3939
4040 container = notifications [ 0 ] . _container ;
41- // Object.values is unsupported in old browsers
42- regions = Array . from ( container . shadowRoot . querySelectorAll ( '[region]' ) ) ;
4341 // To ensure computed styles are applied.
4442 await aTimeout ( ) ;
4543 } ) ;
@@ -138,73 +136,5 @@ describe('multiple notification', () => {
138136 expect ( getComputedStyle ( overlay ) [ 'pointer-events' ] ) . to . be . equal ( 'auto' ) ;
139137 } ) ;
140138 } ) ;
141-
142- it ( 'host should have flex-direction column' , ( ) => {
143- expect ( getComputedStyle ( container ) . flexDirection ) . to . equal ( 'column' ) ;
144- } ) ;
145-
146- it ( 'host should have align items stretch' , ( ) => {
147- expect ( getComputedStyle ( container ) . alignItems ) . to . equal ( 'stretch' ) ;
148- } ) ;
149-
150- it ( 'host should have align items stretch' , ( ) => {
151- expect ( getComputedStyle ( container ) . alignItems ) . to . equal ( 'stretch' ) ;
152- } ) ;
153-
154- it ( 'all region groups and host should be flex containers' , ( ) => {
155- const groups = Array . from ( container . shadowRoot . querySelectorAll ( '[region-group]' ) ) ;
156- groups . push ( container ) ;
157- groups . forEach ( ( el ) => {
158- expect ( getComputedStyle ( el ) . display ) . to . equal ( 'flex' ) ;
159- } ) ;
160- } ) ;
161-
162- it ( 'all regions should be block containers' , ( ) => {
163- regions . forEach ( ( el ) => {
164- expect ( getComputedStyle ( el ) . display ) . to . equal ( 'block' ) ;
165- } ) ;
166- } ) ;
167-
168- it ( 'all region groups should have flex-direction row' , ( ) => {
169- [
170- container . shadowRoot . querySelector ( '[region-group="top"]' ) ,
171- container . shadowRoot . querySelector ( '[region-group="bottom"]' ) ,
172- ] . forEach ( ( el ) => {
173- expect ( getComputedStyle ( el ) . flexDirection ) . to . equal ( 'row' ) ;
174- } ) ;
175- } ) ;
176-
177- it ( 'all region groups should have equal flex stretching' , ( ) => {
178- [
179- container . shadowRoot . querySelector ( '[region-group="top"]' ) ,
180- container . shadowRoot . querySelector ( '[region-group="bottom"]' ) ,
181- ] . forEach ( ( el ) => {
182- expect ( getComputedStyle ( el ) . flexGrow ) . to . equal ( '1' ) ;
183- expect ( parseFloat ( getComputedStyle ( el ) . flexBasis ) ) . to . equal ( 0 ) ;
184- } ) ;
185- } ) ;
186-
187- it ( 'all grouped regions should have equal flex stretching' , ( ) => {
188- Array . from ( container . shadowRoot . querySelectorAll ( '[region-group] > [region]' ) ) . forEach ( ( el ) => {
189- expect ( getComputedStyle ( el ) . flexGrow ) . to . equal ( '1' ) ;
190- expect ( parseFloat ( getComputedStyle ( el ) . flexBasis ) ) . to . equal ( 0 ) ;
191- } ) ;
192- } ) ;
193-
194- it ( 'middle region should not have flex stretching' , ( ) => {
195- const middleRegion = container . shadowRoot . querySelector ( '[region="middle"]' ) ;
196- expect ( getComputedStyle ( middleRegion ) . flexGrow ) . to . equal ( '0' ) ;
197- expect ( getComputedStyle ( middleRegion ) . flexBasis ) . to . equal ( 'auto' ) ;
198- } ) ;
199-
200- it ( 'top region group should align regions to start' , ( ) => {
201- const topRegion = container . shadowRoot . querySelector ( '[region-group="top"]' ) ;
202- expect ( getComputedStyle ( topRegion ) . alignItems ) . to . equal ( 'flex-start' ) ;
203- } ) ;
204-
205- it ( 'bottom region group should align regions to end' , ( ) => {
206- const bottomRegion = container . shadowRoot . querySelector ( '[region-group="bottom"]' ) ;
207- expect ( getComputedStyle ( bottomRegion ) . alignItems ) . to . equal ( 'flex-end' ) ;
208- } ) ;
209139 } ) ;
210140} ) ;
0 commit comments