diff --git a/test/controller.test.js b/test/controller.test.js index a74963a4c..2896e8d22 100644 --- a/test/controller.test.js +++ b/test/controller.test.js @@ -651,7 +651,7 @@ describe('Controller', () => { MQTT.events['connect'](); await flushPromises(); jest.runOnlyPendingTimers(); - expect(MQTT.publish).toHaveBeenCalledTimes(12); + expect(MQTT.publish).toHaveBeenCalledTimes(13); expect(MQTT.publish).toHaveBeenCalledWith('zigbee2mqtt/bridge/info', expect.any(String), { retain: true, qos: 0 }, expect.any(Function)); }); @@ -662,7 +662,8 @@ describe('Controller', () => { await flushPromises(); await MQTT.events.message('zigbee2mqtt/bridge/state', 'online'); jest.runOnlyPendingTimers(); - expect(MQTT.publish).toHaveBeenCalledTimes(0); + expect(MQTT.publish).toHaveBeenCalledTimes(1); + expect(MQTT.publish).toHaveBeenCalledWith('zigbee2mqtt/bridge/state', expect.any(String), { retain: true, qos: 0 }, expect.any(Function)); }); it('Should prevent any message being published with retain flag when force_disable_retain is set', async () => {