From a2a7cebd071803e3e9a910f5531e9727d3009d9f Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 5 Oct 2020 17:43:57 +0200 Subject: [PATCH] Fix tests --- test/legacy/bridgeLegacy.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/legacy/bridgeLegacy.test.js b/test/legacy/bridgeLegacy.test.js index 62b3a19c..6ca2bfa9 100644 --- a/test/legacy/bridgeLegacy.test.js +++ b/test/legacy/bridgeLegacy.test.js @@ -457,22 +457,22 @@ describe('Bridge legacy', () => { }); it('Should allow to touchlink factory reset (OK)', async () => { - zigbeeHerdsman.touchlinkFactoryReset.mockClear(); + zigbeeHerdsman.touchlinkFactoryResetFirst.mockClear(); - zigbeeHerdsman.touchlinkFactoryReset.mockReturnValueOnce(true); + zigbeeHerdsman.touchlinkFactoryResetFirst.mockReturnValueOnce(true); MQTT.events.message('zigbee2mqtt/bridge/config/touchlink/factory_reset', ''); await flushPromises(); - expect(zigbeeHerdsman.touchlinkFactoryReset).toHaveBeenCalledTimes(1); + expect(zigbeeHerdsman.touchlinkFactoryResetFirst).toHaveBeenCalledTimes(1); expect(logger.info).toHaveBeenCalledWith('Successfully factory reset device through Touchlink'); }); it('Should allow to touchlink factory reset (FAILS)', async () => { - zigbeeHerdsman.touchlinkFactoryReset.mockClear(); + zigbeeHerdsman.touchlinkFactoryResetFirst.mockClear(); - zigbeeHerdsman.touchlinkFactoryReset.mockReturnValueOnce(false); + zigbeeHerdsman.touchlinkFactoryResetFirst.mockReturnValueOnce(false); MQTT.events.message('zigbee2mqtt/bridge/config/touchlink/factory_reset', ''); await flushPromises(); - expect(zigbeeHerdsman.touchlinkFactoryReset).toHaveBeenCalledTimes(1); + expect(zigbeeHerdsman.touchlinkFactoryResetFirst).toHaveBeenCalledTimes(1); expect(logger.warn).toHaveBeenCalledWith('Failed to factory reset device through Touchlink'); }); });