11import { Layout } from '../src/types'
22import { defaultContext , getNavWidth , getScreenValue } from '../src/utils'
33
4- const initialContext = defaultContext ( )
5-
64describe ( 'getNavWidth' , ( ) => {
75 describe ( 'variant permanent' , ( ) => {
86 let config : Omit < Layout , 'currentNavWidth' >
97
108 beforeEach ( ( ) => {
11- config = Object . assign ( { } , initialContext , {
9+ config = Object . assign ( { } , defaultContext , {
1210 navVariant : 'permanent' ,
1311 } )
1412 } )
1513
1614 it ( 'returns navWidth when not collapsed and open' , ( ) => {
1715 config . collapsed = false
1816 config . open = true
19- expect ( getNavWidth ( config ) ) . toBe ( initialContext . navWidth )
17+ expect ( getNavWidth ( config ) ) . toBe ( defaultContext . navWidth )
2018 } )
2119
2220 it ( 'returns navWidth when not collapsed and closed' , ( ) => {
2321 config . collapsed = false
2422 config . open = false
25- expect ( getNavWidth ( config ) ) . toBe ( initialContext . navWidth )
23+ expect ( getNavWidth ( config ) ) . toBe ( defaultContext . navWidth )
2624 } )
2725
2826 it ( 'returns collapsedWidth when collapsed and open' , ( ) => {
2927 config . collapsed = true
3028 config . open = true
31- expect ( getNavWidth ( config ) ) . toBe ( initialContext . collapsedWidth )
29+ expect ( getNavWidth ( config ) ) . toBe ( defaultContext . collapsedWidth )
3230 } )
3331
3432 it ( 'returns collapsedWidth when collapsed and closed' , ( ) => {
3533 config . collapsed = true
3634 config . open = false
37- expect ( getNavWidth ( config ) ) . toBe ( initialContext . collapsedWidth )
35+ expect ( getNavWidth ( config ) ) . toBe ( defaultContext . collapsedWidth )
3836 } )
3937 } )
4038
4139 describe ( 'variant persistent' , ( ) => {
4240 let config : Omit < Layout , 'currentNavWidth' >
4341
4442 beforeEach ( ( ) => {
45- config = Object . assign ( { } , initialContext , {
43+ config = Object . assign ( { } , defaultContext , {
4644 navVariant : 'persistent' ,
4745 } )
4846 } )
4947
5048 it ( 'returns navWidth when not collapsed and open' , ( ) => {
5149 config . collapsed = false
5250 config . open = true
53- expect ( getNavWidth ( config ) ) . toBe ( initialContext . navWidth )
51+ expect ( getNavWidth ( config ) ) . toBe ( defaultContext . navWidth )
5452 } )
5553
5654 it ( 'returns 0 when not collapsed and closed' , ( ) => {
@@ -62,7 +60,7 @@ describe('getNavWidth', () => {
6260 it ( 'returns collapsedWidth when collapsed and open' , ( ) => {
6361 config . collapsed = true
6462 config . open = true
65- expect ( getNavWidth ( config ) ) . toBe ( initialContext . collapsedWidth )
63+ expect ( getNavWidth ( config ) ) . toBe ( defaultContext . collapsedWidth )
6664 } )
6765
6866 it ( 'returns 0 when collapsed and closed' , ( ) => {
@@ -76,15 +74,15 @@ describe('getNavWidth', () => {
7674 let config : Omit < Layout , 'currentNavWidth' >
7775
7876 beforeEach ( ( ) => {
79- config = Object . assign ( { } , initialContext , {
77+ config = Object . assign ( { } , defaultContext , {
8078 navVariant : 'temporary' ,
8179 } )
8280 } )
8381
8482 it ( 'returns navWidth when not collapsed and open' , ( ) => {
8583 config . collapsed = false
8684 config . open = true
87- expect ( getNavWidth ( config ) ) . toBe ( initialContext . navWidth )
85+ expect ( getNavWidth ( config ) ) . toBe ( defaultContext . navWidth )
8886 } )
8987
9088 it ( 'returns 0 when not collapsed and closed' , ( ) => {
@@ -96,7 +94,7 @@ describe('getNavWidth', () => {
9694 it ( 'returns collapsedWidth when collapsed and open' , ( ) => {
9795 config . collapsed = true
9896 config . open = true
99- expect ( getNavWidth ( config ) ) . toBe ( initialContext . collapsedWidth )
97+ expect ( getNavWidth ( config ) ) . toBe ( defaultContext . collapsedWidth )
10098 } )
10199
102100 it ( 'returns 0 when collapsed and closed' , ( ) => {
0 commit comments