@@ -215,6 +215,111 @@ test('#enableRippleOnElement throws error if a native element', () => {
215215 ) ;
216216} ) ;
217217
218+ test ( 'when changes from short to fixed the foundation changes' , ( ) => {
219+ const wrapper = shallow ( < TopAppBar short /> ) ;
220+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
221+ wrapper . setProps ( { fixed : true , short : false } ) ;
222+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
223+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
224+ } ) ;
225+
226+ test ( 'when changes from short to fixed the foundation changes' , ( ) => {
227+ const wrapper = shallow ( < TopAppBar short /> ) ;
228+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
229+ wrapper . setProps ( { fixed : true , short : false } ) ;
230+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
231+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
232+ } ) ;
233+
234+ test ( 'when changes from short to standard the foundation changes' , ( ) => {
235+ const wrapper = shallow ( < TopAppBar short /> ) ;
236+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
237+ wrapper . setProps ( { short : false } ) ;
238+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
239+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
240+ } ) ;
241+
242+ test ( 'when changes from short to prominent the foundation changes' , ( ) => {
243+ const wrapper = shallow ( < TopAppBar short /> ) ;
244+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
245+ wrapper . setProps ( { short : false , prominent : true } ) ;
246+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
247+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
248+ } ) ;
249+
250+ test ( 'when changes from short to shortCollpased the foundation changes' , ( ) => {
251+ const wrapper = shallow ( < TopAppBar short /> ) ;
252+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
253+ wrapper . setProps ( { shortCollapsed : true } ) ;
254+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
255+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
256+ } ) ;
257+
258+ test ( 'when changes from fixed to prominent the foundation changes' , ( ) => {
259+ const wrapper = shallow ( < TopAppBar fixed /> ) ;
260+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
261+ wrapper . setProps ( { fixed : false , prominent : true } ) ;
262+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
263+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
264+ } ) ;
265+
266+ test ( 'when changes from fixed to short the foundation changes' , ( ) => {
267+ const wrapper = shallow ( < TopAppBar fixed /> ) ;
268+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
269+ wrapper . setProps ( { fixed : false , short : true } ) ;
270+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
271+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
272+ } ) ;
273+
274+ test ( 'when changes from fixed to shortCollpased the foundation changes' , ( ) => {
275+ const wrapper = shallow ( < TopAppBar fixed /> ) ;
276+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
277+ wrapper . setProps ( { fixed : false , shortCollapsed : true } ) ;
278+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
279+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
280+ } ) ;
281+
282+ test ( 'when changes from fixed to standard the foundation changes' , ( ) => {
283+ const wrapper = shallow ( < TopAppBar fixed /> ) ;
284+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
285+ wrapper . setProps ( { fixed : false } ) ;
286+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
287+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
288+ } ) ;
289+
290+ test ( 'when changes from standard to fixed the foundation changes' , ( ) => {
291+ const wrapper = shallow ( < TopAppBar /> ) ;
292+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
293+ wrapper . setProps ( { fixed : true } ) ;
294+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
295+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
296+ } ) ;
297+
298+ test ( 'when changes from standard to short the foundation changes' , ( ) => {
299+ const wrapper = shallow ( < TopAppBar /> ) ;
300+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
301+ wrapper . setProps ( { short : true } ) ;
302+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
303+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
304+ } ) ;
305+
306+ test ( 'when changes from standard to shortCollapsed the foundation changes' , ( ) => {
307+ const wrapper = shallow ( < TopAppBar /> ) ;
308+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
309+ wrapper . setProps ( { shortCollapsed : true } ) ;
310+ assert . notEqual ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
311+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
312+ } ) ;
313+
314+ test ( 'when changes from standard to prominent the foundation does not ' +
315+ 'change' , ( ) => {
316+ const wrapper = shallow ( < TopAppBar /> ) ;
317+ const originalFoundation = wrapper . instance ( ) . foundation_ ;
318+ wrapper . setProps ( { prominent : true } ) ;
319+ assert . equal ( wrapper . instance ( ) . foundation_ , originalFoundation ) ;
320+ assert . exists ( wrapper . instance ( ) . foundation_ ) ;
321+ } ) ;
322+
218323test ( '#componentWillUnmount destroys foundation' , ( ) => {
219324 const wrapper = shallow ( < TopAppBar /> ) ;
220325 const foundation = wrapper . instance ( ) . foundation_ ;
0 commit comments