191 |
192 |
193 | {{machine.statePath}}
194 |
195 |
198 |
199 |
200 |
201 |
202 | {{machine.statePath}}
203 |
204 |
207 |
208 |
209 |
210 | );
211 |
212 | assert.dom('#one').containsText('inactive');
213 | assert.dom('#two').containsText('inactive');
214 |
215 | await click('#one button');
216 |
217 | assert.dom('#one').doesNotContainText('inactive');
218 | assert.dom('#one').containsText('active');
219 | assert.dom('#two').containsText('inactive');
220 | });
221 |
222 | test('can pass config', async function (assert) {
223 | const Toggle = createMachine({
224 | initial: 'inactive',
225 | states: {
226 | inactive: { entry: 'increment', on: { TOGGLE: 'active' } },
227 | active: { entry: 'increment', on: { TOGGLE: 'inactive' } },
228 | },
229 | });
230 |
231 | let numCalled = 0;
232 |
233 | const config = {
234 | actions: {
235 | increment: () => numCalled++,
236 | },
237 | };
238 |
239 | await render(
240 |