@@ -18,6 +18,7 @@ import {
18
18
} from '../../../../../src/editors/protocol104/wizards/createAddresses.js' ;
19
19
20
20
import { fetchDoc } from '../../../wizards/test-support.js' ;
21
+ import { Switch } from '@material/mwc-switch' ;
21
22
22
23
describe ( 'Wizards for preparing 104 Address Creation' , ( ) => {
23
24
let doc : XMLDocument ;
@@ -27,7 +28,7 @@ describe('Wizards for preparing 104 Address Creation', () => {
27
28
let inputs : WizardInputElement [ ] ;
28
29
29
30
beforeEach ( async ( ) => {
30
- doc = await fetchDoc ( '/test/testfiles/104/valid-addresses.scd' ) ;
31
+ doc = await fetchDoc ( '/test/testfiles/104/valid-empty- addresses.scd' ) ;
31
32
element = await fixture ( html `< mock-wizard > </ mock-wizard > ` ) ;
32
33
} ) ;
33
34
@@ -76,7 +77,7 @@ describe('Wizards for preparing 104 Address Creation', () => {
76
77
lnElement ,
77
78
doElement ,
78
79
false
79
- ) ( inputs , element ) ;
80
+ ) ( inputs , element . wizardUI ) ;
80
81
81
82
expectCreateActions ( actions , 1 ) ;
82
83
} ) ;
@@ -98,7 +99,7 @@ describe('Wizards for preparing 104 Address Creation', () => {
98
99
lnElement ,
99
100
doElement ,
100
101
false
101
- ) ( inputs , element ) ;
102
+ ) ( inputs , element . wizardUI ) ;
102
103
103
104
expectCreateActions ( actions , 1 ) ;
104
105
} ) ;
@@ -121,7 +122,7 @@ describe('Wizards for preparing 104 Address Creation', () => {
121
122
lnElement ,
122
123
doElement ,
123
124
false
124
- ) ( inputs , element ) ;
125
+ ) ( inputs , element . wizardUI ) ;
125
126
126
127
expectCreateActions ( actions , 1 ) ;
127
128
} ) ;
@@ -139,14 +140,30 @@ describe('Wizards for preparing 104 Address Creation', () => {
139
140
) ;
140
141
} ) ;
141
142
142
- it ( 'when processing the request, the expected Create Actions are returned' , ( ) => {
143
+ it ( 'when processing the request without Check Selected , the expected Create Actions are returned' , ( ) => {
143
144
const actions = createAddressesAction (
144
145
lnElement ,
145
146
doElement ,
146
- false
147
- ) ( inputs , element ) ;
147
+ true
148
+ ) ( inputs , element . wizardUI ) ;
148
149
149
- expectCreateActions ( actions , 1 ) ;
150
+ expectCreateActions ( actions , 2 ) ;
151
+ } ) ;
152
+
153
+ it ( 'when processing the request with Check Selected, the expected Create Actions are returned' , async ( ) => {
154
+ const switchElement = element . wizardUI . dialog ! . querySelector < Switch > (
155
+ `mwc-switch[id="controlCheck"]`
156
+ ) ! ;
157
+ switchElement . checked = true ;
158
+ await element . requestUpdate ( ) ;
159
+
160
+ const actions = createAddressesAction (
161
+ lnElement ,
162
+ doElement ,
163
+ true
164
+ ) ( inputs , element . wizardUI ) ;
165
+
166
+ expectCreateActions ( actions , 3 ) ;
150
167
} ) ;
151
168
152
169
it ( 'looks like the latest snapshot' , async ( ) => {
0 commit comments