Skip to content

Commit

Permalink
Remove invalid test: The <cancel> element is used to cancel a delayed…
Browse files Browse the repository at this point in the history
… <send> event.
  • Loading branch information
davidkpiano committed Oct 20, 2024
1 parent 4516833 commit ab4bad0
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions packages/core/test/actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3753,51 +3753,6 @@ describe('cancel', () => {
await sleep(10);
expect(spy.mock.calls.length).toBe(0);
});

it('should not be able to cancel a just scheduled non-delayed event to a just invoked child', async () => {
const spy = jest.fn();

const child = createMachine({
on: {
PING: {
actions: spy
}
}
});

const machine = setup({
actors: {
child
}
}).createMachine({
initial: 'a',
states: {
a: {
on: {
START: 'b'
}
},
b: {
entry: [
sendTo('myChild', { type: 'PING' }, { id: 'myEvent' }),
cancel('myEvent')
],
invoke: {
src: 'child',
id: 'myChild'
}
}
}
});

const actorRef = createActor(machine).start();

actorRef.send({
type: 'START'
});

expect(spy.mock.calls.length).toBe(1);
});
});

describe('assign action order', () => {
Expand Down

0 comments on commit ab4bad0

Please sign in to comment.