diff --git a/src/matterbridgeDevice.test.ts b/src/matterbridgeDevice.test.ts index d1f34877..63f0c910 100644 --- a/src/matterbridgeDevice.test.ts +++ b/src/matterbridgeDevice.test.ts @@ -55,10 +55,13 @@ import { MatterbridgeDevice } from './matterbridgeDevice.js'; describe('Matterbridge device serialize/deserialize', () => { test('create a basic device with all default clusters', async () => { - const device = new MatterbridgeDevice(DeviceTypes.ON_OFF_LIGHT); + let device = new MatterbridgeDevice(DeviceTypes.ON_OFF_LIGHT); + expect(device.getDeviceTypes()).toHaveLength(1); MatterbridgeDevice.bridgeMode = 'bridge'; device.createDefaultBasicInformationClusterServer('Name', 'Serial', 1, 'VendorName', 1, 'ProductName'); + expect(device.getDeviceTypes()).toHaveLength(2); MatterbridgeDevice.bridgeMode = ''; + device = new MatterbridgeDevice(DeviceTypes.ON_OFF_LIGHT); device.createDefaultBasicInformationClusterServer('Name', 'Serial', 1, 'VendorName', 1, 'ProductName'); device.createDefaultBasicInformationClusterServer('Name', 'Serial', 1, 'VendorName', 1, 'ProductName', 1, '1.0.0', 1, '1.0.0'); device.createDefaultIdentifyClusterServer(); @@ -67,14 +70,14 @@ describe('Matterbridge device serialize/deserialize', () => { device.createDefaultOnOffClusterServer(); expect(device.getDeviceTypes()).toHaveLength(1); expect(() => device.verifyRequiredClusters()).not.toThrow(); - expect(device.getAllClusterServers()).toHaveLength(7); + expect(device.getAllClusterServers()).toHaveLength(6); const serialized = device.serialize(); expect(serialized).toBeDefined(); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const deserialized = MatterbridgeDevice.deserialize(serialized!); expect(deserialized).toBeDefined(); expect(deserialized.getDeviceTypes()).toHaveLength(1); - expect(deserialized.getAllClusterServers()).toHaveLength(7); + expect(deserialized.getAllClusterServers()).toHaveLength(6); expect(() => deserialized.verifyRequiredClusters()).not.toThrow(); });