@@ -251,7 +251,7 @@ describe('Vuex', () => {
251251 const store = new Vuex . Store ( {
252252 modules : {
253253 a : {
254- namespace : 'prefix/'
254+ namespaced : true
255255 }
256256 }
257257 } )
@@ -265,12 +265,12 @@ describe('Vuex', () => {
265265 } )
266266
267267 expect ( store . state . a . b . value ) . toBe ( 1 )
268- expect ( store . getters [ 'prefix /foo' ] ) . toBe ( 1 )
268+ expect ( store . getters [ 'a /foo' ] ) . toBe ( 1 )
269269
270- store . dispatch ( 'prefix /foo' )
270+ store . dispatch ( 'a /foo' )
271271 expect ( actionSpy ) . toHaveBeenCalled ( )
272272
273- store . commit ( 'prefix /foo' )
273+ store . commit ( 'a /foo' )
274274 expect ( mutationSpy ) . toHaveBeenCalled ( )
275275 } )
276276
@@ -614,7 +614,7 @@ describe('Vuex', () => {
614614 const store = new Vuex . Store ( {
615615 modules : {
616616 a : {
617- namespace : 'prefix/' ,
617+ namespaced : true ,
618618 state : {
619619 a : 1
620620 } ,
@@ -632,26 +632,26 @@ describe('Vuex', () => {
632632 } )
633633
634634 expect ( store . state . a . a ) . toBe ( 1 )
635- expect ( store . getters [ 'prefix /b' ] ) . toBe ( 2 )
636- store . dispatch ( 'prefix /' + TEST )
635+ expect ( store . getters [ 'a /b' ] ) . toBe ( 2 )
636+ store . dispatch ( 'a /' + TEST )
637637 expect ( actionSpy ) . toHaveBeenCalled ( )
638- store . commit ( 'prefix /' + TEST )
638+ store . commit ( 'a /' + TEST )
639639 expect ( mutationSpy ) . toHaveBeenCalled ( )
640640 } )
641641
642642 it ( 'module: nested namespace' , ( ) => {
643643 // mock module generator
644644 const actionSpys = [ ]
645645 const mutationSpys = [ ]
646- const createModule = ( name , namespace , children ) => {
646+ const createModule = ( name , namespaced , children ) => {
647647 const actionSpy = jasmine . createSpy ( )
648648 const mutationSpy = jasmine . createSpy ( )
649649
650650 actionSpys . push ( actionSpy )
651651 mutationSpys . push ( mutationSpy )
652652
653653 return {
654- namespace ,
654+ namespaced ,
655655 state : {
656656 [ name ] : true
657657 } ,
@@ -670,11 +670,11 @@ describe('Vuex', () => {
670670
671671 // mock module
672672 const modules = {
673- a : createModule ( 'a' , 'a/' , { // a/a
674- b : createModule ( 'b' , null , { // a/b - does not add namespace
675- c : createModule ( 'c' , 'c/' ) // a/c/c
673+ a : createModule ( 'a' , true , { // a/a
674+ b : createModule ( 'b' , false , { // a/b - does not add namespace
675+ c : createModule ( 'c' , true ) // a/c/c
676676 } ) ,
677- d : createModule ( 'd' , 'd/' ) , // a/d/d
677+ d : createModule ( 'd' , true ) , // a/d/d
678678 } )
679679 }
680680
@@ -714,7 +714,7 @@ describe('Vuex', () => {
714714 } ,
715715 modules : {
716716 a : {
717- namespace : 'prefix/' ,
717+ namespaced : true ,
718718 state : { value : 'module' } ,
719719 getters : {
720720 foo : state => state . value ,
@@ -725,9 +725,9 @@ describe('Vuex', () => {
725725 }
726726 } )
727727
728- expect ( store . getters [ 'prefix /foo' ] ) . toBe ( 'module' )
729- expect ( store . getters [ 'prefix /bar' ] ) . toBe ( 'module' )
730- expect ( store . getters [ 'prefix /baz' ] ) . toBe ( 'root' )
728+ expect ( store . getters [ 'a /foo' ] ) . toBe ( 'module' )
729+ expect ( store . getters [ 'a /bar' ] ) . toBe ( 'module' )
730+ expect ( store . getters [ 'a /baz' ] ) . toBe ( 'root' )
731731 } )
732732
733733 it ( 'module: action context is namespaced in namespaced module' , done => {
@@ -743,7 +743,7 @@ describe('Vuex', () => {
743743 mutations : { foo : rootMutationSpy } ,
744744 modules : {
745745 a : {
746- namespace : 'prefix/' ,
746+ namespaced : true ,
747747 state : { value : 'module' } ,
748748 getters : { foo : state => state . value } ,
749749 actions : {
@@ -770,7 +770,7 @@ describe('Vuex', () => {
770770 }
771771 } )
772772
773- store . dispatch ( 'prefix /test' )
773+ store . dispatch ( 'a /test' )
774774 } )
775775
776776 it ( 'module: use other module that has same namespace' , done => {
@@ -780,7 +780,7 @@ describe('Vuex', () => {
780780 const store = new Vuex . Store ( {
781781 modules : {
782782 parent : {
783- namespace : 'prefix/' ,
783+ namespaced : true ,
784784
785785 modules : {
786786 a : {
@@ -813,7 +813,7 @@ describe('Vuex', () => {
813813 }
814814 } )
815815
816- store . dispatch ( 'prefix /test' )
816+ store . dispatch ( 'parent /test' )
817817 } )
818818
819819 it ( 'dispatching multiple actions in different modules' , done => {
@@ -1210,7 +1210,7 @@ describe('Vuex', () => {
12101210 const store = new Vuex . Store ( {
12111211 modules : {
12121212 a : {
1213- namespace : 'prefix/' ,
1213+ namespaced : true ,
12141214 state : { value : 1 } ,
12151215 getters : { foo : state => state . value } ,
12161216 actions : { foo : actionSpy } ,
@@ -1220,38 +1220,38 @@ describe('Vuex', () => {
12201220 } )
12211221
12221222 expect ( store . state . a . value ) . toBe ( 1 )
1223- expect ( store . getters [ 'prefix /foo' ] ) . toBe ( 1 )
1224- store . dispatch ( 'prefix /foo' )
1223+ expect ( store . getters [ 'a /foo' ] ) . toBe ( 1 )
1224+ store . dispatch ( 'a /foo' )
12251225 expect ( actionSpy . calls . count ( ) ) . toBe ( 1 )
1226- store . commit ( 'prefix /foo' )
1226+ store . commit ( 'a /foo' )
12271227 expect ( actionSpy . calls . count ( ) ) . toBe ( 1 )
12281228
12291229 store . hotUpdate ( {
12301230 modules : {
12311231 a : {
1232- namespace : 'prefix-changed/'
1232+ namespaced : false
12331233 }
12341234 }
12351235 } )
12361236
12371237 expect ( store . state . a . value ) . toBe ( 1 )
1238- expect ( store . getters [ 'prefix /foo' ] ) . toBe ( undefined ) // removed
1239- expect ( store . getters [ 'prefix-changed/ foo' ] ) . toBe ( 1 ) // renamed
1238+ expect ( store . getters [ 'a /foo' ] ) . toBe ( undefined ) // removed
1239+ expect ( store . getters [ 'foo' ] ) . toBe ( 1 ) // renamed
12401240
12411241 // should not be called
1242- store . dispatch ( 'prefix /foo' )
1242+ store . dispatch ( 'a /foo' )
12431243 expect ( actionSpy . calls . count ( ) ) . toBe ( 1 )
12441244
12451245 // should be called
1246- store . dispatch ( 'prefix-changed/ foo' )
1246+ store . dispatch ( 'foo' )
12471247 expect ( actionSpy . calls . count ( ) ) . toBe ( 2 )
12481248
12491249 // should not be called
1250- store . commit ( 'prefix /foo' )
1250+ store . commit ( 'a /foo' )
12511251 expect ( mutationSpy . calls . count ( ) ) . toBe ( 1 )
12521252
12531253 // should be called
1254- store . commit ( 'prefix-changed/ foo' )
1254+ store . commit ( 'foo' )
12551255 expect ( mutationSpy . calls . count ( ) ) . toBe ( 2 )
12561256 } )
12571257
0 commit comments