Skip to content

Commit

Permalink
Add missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Nov 8, 2024
1 parent 1068419 commit 51b221d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions server/test/lib/scene/triggers/scene.trigger.alarmMode.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,40 @@ describe('Scene.triggers.alarmMode', () => {
});
});
});
it('should execute scene with alarm.too-many-codes-tests trigger', async () => {
sceneManager.addScene({
selector: 'my-scene',
active: true,
actions: [
[
{
type: ACTIONS.LIGHT.TURN_OFF,
devices: ['light-1'],
},
],
],
triggers: [
{
type: EVENTS.ALARM.TOO_MANY_CODES_TESTS,
house: 'house-1',
},
],
});
sceneManager.checkTrigger({
type: EVENTS.ALARM.TOO_MANY_CODES_TESTS,
house: 'house-1',
});
return new Promise((resolve, reject) => {
sceneManager.queue.start(() => {
try {
assert.calledOnce(device.setValue);
resolve();
} catch (e) {
reject(e);
}
});
});
});
it('should not execute scene (house not matching)', async () => {
sceneManager.addScene({
selector: 'my-scene',
Expand Down

0 comments on commit 51b221d

Please sign in to comment.