import type { ChargingStationData, ConfigurationData, UUIDv4 } from '@/types'
-import { SHARED_TOGGLE_BUTTON_KEY_PREFIX, TOGGLE_BUTTON_KEY_PREFIX } from './Constants'
+import {
+ EMPTY_VALUE_PLACEHOLDER,
+ SHARED_TOGGLE_BUTTON_KEY_PREFIX,
+ TOGGLE_BUTTON_KEY_PREFIX,
+} from './Constants'
import { UIClient } from './UIClient'
export const configurationKey: InjectionKey<Ref<ConfigurationData>> = Symbol('configuration')
/**
* Returns a human-readable name for a WebSocket ready state.
* @param state - The WebSocket readyState value
- * @returns The state name or 'Ø' for unknown/undefined states
+ * @returns The state name or EMPTY_VALUE_PLACEHOLDER for unknown/undefined states
*/
export const getWebSocketStateName = (state: number | undefined): string => {
switch (state) {
case WebSocket.OPEN:
return 'Open'
default:
- return 'Ø'
+ return EMPTY_VALUE_PLACEHOLDER
}
}
import CSConnector from '@/components/charging-stations/CSConnector.vue'
import { useUIClient } from '@/composables'
+import { EMPTY_VALUE_PLACEHOLDER } from '@/composables/Constants'
import { OCPP16ChargePointStatus } from '@/types'
import { toastMock } from '../setup'
connector: createConnectorStatus({ status: undefined }),
})
const cells = wrapper.findAll('td')
- expect(cells[1].text()).toBe('Ø')
+ expect(cells[1].text()).toBe(EMPTY_VALUE_PLACEHOLDER)
})
it('should display No when transaction not started', () => {
import CSConnector from '@/components/charging-stations/CSConnector.vue'
import CSData from '@/components/charging-stations/CSData.vue'
import { useUIClient } from '@/composables'
+import { EMPTY_VALUE_PLACEHOLDER } from '@/composables/Constants'
import { OCPPVersion } from '@/types'
import { toastMock } from '../setup'
})
const wrapper = mountCSData(station)
const cells = wrapper.findAll('td')
- expect(cells[9].text()).toBe('Ø')
+ expect(cells[9].text()).toBe(EMPTY_VALUE_PLACEHOLDER)
})
it('should display WebSocket state as Open when OPEN', () => {
it('should display WebSocket state as Ø for undefined state', () => {
const wrapper = mountCSData(createChargingStationData({ wsState: undefined }))
const cells = wrapper.findAll('td')
- expect(cells[3].text()).toBe('Ø')
+ expect(cells[3].text()).toBe(EMPTY_VALUE_PLACEHOLDER)
})
it('should display registration status', () => {
const station = createChargingStationData({ bootNotificationResponse: undefined })
const wrapper = mountCSData(station)
const cells = wrapper.findAll('td')
- expect(cells[4].text()).toBe('Ø')
+ expect(cells[4].text()).toBe(EMPTY_VALUE_PLACEHOLDER)
})
it('should display WebSocket state as Connecting when CONNECTING', () => {