Skip to content

Commit 02cf23b

Browse files
committed
improve coverage of Slot class
1 parent 60e5cd2 commit 02cf23b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/org/osflash/signals/SlotTest.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ describe("SlotTest", () => {
6969
assert.deepEqual(received, expected);
7070
});
7171

72+
it("execute0_with_once_enabled_should_remove_listener", () => {
73+
expected = [];
74+
slot = new Slot(listener0, signal, true);
75+
slot.execute0();
76+
assert.deepEqual(received, expected);
77+
});
78+
7279
it("execute1_should_not_call_listener_when_disabled", () => {
7380
slot = new Slot(listener1, signal);
7481
slot.enabled = false;
@@ -100,6 +107,13 @@ describe("SlotTest", () => {
100107
assert.deepEqual(received, expected);
101108
});
102109

110+
it("execute1_with_once_enabled_should_remove_listener", () => {
111+
expected = [42];
112+
slot = new Slot(listener1, signal, true);
113+
slot.execute1(expected[0]);
114+
assert.deepEqual(received, expected);
115+
});
116+
103117
it("execute_should_not_call_listener_when_disabled", () => {
104118
slot = new Slot(listener0, signal);
105119
slot.enabled = false;

0 commit comments

Comments
 (0)