@@ -10,15 +10,15 @@ suite('vuex tab', () => {
10
10
get ( '#counter p' ) . contains ( '1' )
11
11
} )
12
12
cy . get ( '.vuex-tab' ) . click ( )
13
- cy . get ( '.history .entry' ) . should ( 'have.length' , 4 )
13
+ cy . get ( '.history .entry' ) . should ( 'have.length' , 5 )
14
14
cy . get ( '[data-id="load-vuex-state"]' ) . click ( )
15
15
cy . get ( '.recording-vuex-state' ) . should ( 'not.be.visible' )
16
16
cy . get ( '.loading-vuex-state' ) . should ( 'not.be.visible' )
17
17
cy . get ( '.vuex-state-inspector' ) . then ( el => {
18
18
expect ( el . text ( ) ) . to . include ( 'type:"DECREMENT"' )
19
19
expect ( el . text ( ) ) . to . include ( 'count:1' )
20
20
} )
21
- cy . get ( '.history .entry' ) . eq ( 3 ) . should ( 'have.class' , 'inspected' ) . should ( 'have.class' , 'active' )
21
+ cy . get ( '.history .entry' ) . eq ( 4 ) . should ( 'have.class' , 'inspected' ) . should ( 'have.class' , 'active' )
22
22
} )
23
23
24
24
it ( 'should filter state & getters' , ( ) => {
@@ -41,7 +41,7 @@ suite('vuex tab', () => {
41
41
cy . get ( '.history .entry[data-active="true"].active' ) . should ( 'have.length' , 0 )
42
42
43
43
cy . get ( '.left .search input' ) . clear ( ) . type ( '/dec)/i' )
44
- cy . get ( '.history .entry[data-active="true"]' ) . should ( 'have.length' , 3 )
44
+ cy . get ( '.history .entry[data-active="true"]' ) . should ( 'have.length' , 4 )
45
45
cy . get ( '.history .entry[data-active="true"].inspected' ) . should ( 'have.length' , 0 )
46
46
cy . get ( '.history .entry[data-active="true"].active' ) . should ( 'have.length' , 1 )
47
47
@@ -65,19 +65,19 @@ suite('vuex tab', () => {
65
65
} )
66
66
67
67
it ( 'should time-travel' , ( ) => {
68
- cy . get ( '.history .entry[data-index="2 "] .entry-actions .action-time-travel' ) . click ( { force : true } )
69
- cy . get ( '.history .entry[data-index="2 "]' )
68
+ cy . get ( '.history .entry[data-index="3 "] .entry-actions .action-time-travel' ) . click ( { force : true } )
69
+ cy . get ( '.history .entry[data-index="3 "]' )
70
70
. should ( 'have.class' , 'inspected' )
71
71
. should ( 'have.class' , 'active' )
72
72
cy . get ( '#target' ) . iframe ( ) . then ( ( { get } ) => {
73
73
get ( '#counter p' ) . contains ( '2' )
74
74
} )
75
75
76
- cy . get ( '.history .entry[data-index="1 "] .mutation-type' ) . click ( { force : true } )
77
- cy . get ( '.history .entry[data-index="1 "]' )
76
+ cy . get ( '.history .entry[data-index="2 "] .mutation-type' ) . click ( { force : true } )
77
+ cy . get ( '.history .entry[data-index="2 "]' )
78
78
. should ( 'have.class' , 'inspected' )
79
79
. should ( 'not.have.class' , 'active' )
80
- cy . get ( '.history .entry[data-index="2 "]' )
80
+ cy . get ( '.history .entry[data-index="3 "]' )
81
81
. should ( 'not.have.class' , 'inspected' )
82
82
. should ( 'have.class' , 'active' )
83
83
cy . get ( '.recording-vuex-state' ) . should ( 'not.be.visible' )
@@ -90,11 +90,11 @@ suite('vuex tab', () => {
90
90
cy . get ( '#target' ) . iframe ( ) . then ( ( { get } ) => {
91
91
get ( '#counter p' ) . contains ( '2' )
92
92
} )
93
- cy . get ( '.history .entry[data-index="1 "] .entry-actions .action-time-travel' ) . click ( { force : true } )
94
- cy . get ( '.history .entry[data-index="1 "]' )
93
+ cy . get ( '.history .entry[data-index="2 "] .entry-actions .action-time-travel' ) . click ( { force : true } )
94
+ cy . get ( '.history .entry[data-index="2 "]' )
95
95
. should ( 'have.class' , 'inspected' )
96
96
. should ( 'have.class' , 'active' )
97
- cy . get ( '.history .entry[data-index="2 "]' )
97
+ cy . get ( '.history .entry[data-index="3 "]' )
98
98
. should ( 'not.have.class' , 'inspected' )
99
99
. should ( 'not.have.class' , 'active' )
100
100
cy . get ( '#target' ) . iframe ( ) . then ( ( { get } ) => {
@@ -112,8 +112,8 @@ suite('vuex tab', () => {
112
112
cy . get ( '#target' ) . iframe ( ) . then ( ( { get } ) => {
113
113
get ( '#counter p' ) . contains ( '1' )
114
114
} )
115
- cy . get ( '.history .entry[data-index="0 "] .entry-actions .action-time-travel' ) . click ( { force : true } )
116
- cy . get ( '.history .entry[data-index="0 "]' )
115
+ cy . get ( '.history .entry[data-index="1 "] .entry-actions .action-time-travel' ) . click ( { force : true } )
116
+ cy . get ( '.history .entry[data-index="1 "]' )
117
117
. should ( 'have.class' , 'inspected' )
118
118
. should ( 'have.class' , 'active' )
119
119
cy . get ( '#target' ) . iframe ( ) . then ( ( { get } ) => {
@@ -122,10 +122,10 @@ suite('vuex tab', () => {
122
122
} )
123
123
124
124
it ( 'should revert' , ( ) => {
125
- cy . get ( '.history .entry[data-index="3 "] .mutation-type' ) . click ( { force : true } )
126
- cy . get ( '.history .entry[data-index="3 "]' ) . find ( '.action-revert' ) . click ( { force : true } )
127
- cy . get ( '.history .entry[data-active="true"]' ) . should ( 'have.length' , 3 )
128
- cy . get ( '.history .entry[data-index="2 "]' )
125
+ cy . get ( '.history .entry[data-index="4 "] .mutation-type' ) . click ( { force : true } )
126
+ cy . get ( '.history .entry[data-index="4 "]' ) . find ( '.action-revert' ) . click ( { force : true } )
127
+ cy . get ( '.history .entry[data-active="true"]' ) . should ( 'have.length' , 4 )
128
+ cy . get ( '.history .entry[data-index="3 "]' )
129
129
. should ( 'have.class' , 'inspected' )
130
130
. should ( 'have.class' , 'active' )
131
131
cy . get ( '.vuex-state-inspector' ) . then ( el => {
@@ -137,8 +137,7 @@ suite('vuex tab', () => {
137
137
} )
138
138
139
139
it ( 'should commit' , ( ) => {
140
- cy . get ( '.history .entry[data-index="2"] .mutation-type' ) . click ( { force : true } )
141
- cy . get ( '.history .entry[data-index="2"] .action-commit' ) . click ( { force : true } )
140
+ cy . get ( '.history .entry[data-index="3"] .action-commit' ) . click ( { force : true } )
142
141
cy . get ( '.history .entry[data-active="true"]' ) . should ( 'have.length' , 1 )
143
142
cy . get ( '.history .entry[data-index="0"]' )
144
143
. should ( 'have.class' , 'inspected' )
@@ -152,20 +151,23 @@ suite('vuex tab', () => {
152
151
} )
153
152
154
153
it ( 'should display getters' , ( ) => {
155
- cy . get ( '.vuex-state-inspector' ) . then ( el => {
156
- expect ( el . text ( ) ) . to . include ( 'isPositive:true' )
154
+ cy . get ( '.vuex-state-inspector' ) . within ( ( ) => {
155
+ cy . get ( '.key' ) . contains ( 'count' ) . parent ( ) . contains ( '2' )
156
+ cy . get ( '.key' ) . contains ( 'isPositive' ) . parent ( ) . contains ( 'true' )
157
157
} )
158
158
cy . get ( '#target' ) . iframe ( ) . then ( ( { get } ) => {
159
159
get ( '.decrement' )
160
160
. click ( { force : true } )
161
161
. click ( { force : true } )
162
162
. click ( { force : true } )
163
+ get ( '#counter p' ) . contains ( '-1' )
163
164
} )
164
165
cy . get ( '.history .entry[data-index="3"]' ) . click ( { force : true } )
165
166
cy . get ( '.recording-vuex-state' ) . should ( 'not.be.visible' )
166
167
cy . get ( '.loading-vuex-state' ) . should ( 'not.be.visible' )
167
- cy . get ( '.vuex-state-inspector' ) . then ( el => {
168
- expect ( el . text ( ) ) . to . include ( 'isPositive:false' )
168
+ cy . get ( '.vuex-state-inspector' ) . within ( ( ) => {
169
+ cy . get ( '.key' ) . contains ( 'count' ) . parent ( ) . contains ( '-1' )
170
+ cy . get ( '.key' ) . contains ( 'isPositive' ) . parent ( ) . contains ( 'false' )
169
171
} )
170
172
} )
171
173
@@ -178,7 +180,7 @@ suite('vuex tab', () => {
178
180
cy . get ( '#target' ) . iframe ( ) . then ( ( { get } ) => {
179
181
get ( '.increment' ) . click ( { force : true } )
180
182
} )
181
- cy . get ( '.history .entry' ) . should ( 'have.length' , 4 )
183
+ cy . get ( '.history .entry' ) . should ( 'have.length' , 5 )
182
184
} )
183
185
184
186
it ( 'should copy vuex state' , ( ) => {
0 commit comments