test: add ConfigurationData enums tests
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 1 Jul 2024 22:29:09 +0000 (00:29 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 1 Jul 2024 22:29:09 +0000 (00:29 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
tests/types/ConfigurationData.test.ts [new file with mode: 0644]

diff --git a/tests/types/ConfigurationData.test.ts b/tests/types/ConfigurationData.test.ts
new file mode 100644 (file)
index 0000000..cb5ca2e
--- /dev/null
@@ -0,0 +1,29 @@
+import { describe, it } from 'node:test'
+
+import { expect } from 'expect'
+
+import {
+  ApplicationProtocolVersion,
+  ConfigurationSection,
+  SupervisionUrlDistribution
+} from '../../src/types/ConfigurationData.js'
+
+await describe('ConfigurationData test suite', async () => {
+  await it('Verify ConfigurationSection enumeration', () => {
+    expect(ConfigurationSection.log).toBe('log')
+    expect(ConfigurationSection.performanceStorage).toBe('performanceStorage')
+    expect(ConfigurationSection.worker).toBe('worker')
+    expect(ConfigurationSection.uiServer).toBe('uiServer')
+  })
+
+  await it('Verify SupervisionUrlDistribution enumeration', () => {
+    expect(SupervisionUrlDistribution.ROUND_ROBIN).toBe('round-robin')
+    expect(SupervisionUrlDistribution.RANDOM).toBe('random')
+    expect(SupervisionUrlDistribution.CHARGING_STATION_AFFINITY).toBe('charging-station-affinity')
+  })
+
+  await it('Verify ApplicationProtocolVersion enumeration', () => {
+    expect(ApplicationProtocolVersion.VERSION_11).toBe('1.1')
+    expect(ApplicationProtocolVersion.VERSION_20).toBe('2.0')
+  })
+})