/** Closes the WebSocket connection to the central server. */
public closeWSConnection (): void {
- if (this.wsConnection != null) {
- if (this.isWebSocketConnectionOpened()) {
- this.wsConnection.close()
- }
- this.wsConnection = null
+ if (this.isWebSocketConnectionOpened()) {
+ this.wsConnection?.close()
}
}
private terminateWSConnection (): void {
if (this.isWebSocketConnectionOpened()) {
this.wsConnection?.terminate()
- this.wsConnection = null
}
}
}
await wrapper.find('.modern-connector__lock').trigger('click')
await flushPromises()
expect(mockClient.lockConnector).toHaveBeenCalled()
- expect(wrapper.emitted('need-refresh')).toHaveLength(1)
})
it('should call unlockConnector when locked', async () => {
},
StartTransactionDialog: true,
StationCard: {
- emits: ['need-refresh', 'open-authorize', 'open-set-url', 'open-start-tx'],
+ emits: ['open-authorize', 'open-set-url', 'open-start-tx'],
props: ['chargingStation'],
- template:
- '<article class="stub-station-card"><button class="stub-need-refresh" @click="$emit(\'need-refresh\')">r</button></article>',
+ template: '<article class="stub-station-card"></article>',
},
},
},
SimulatorBar: true,
StartTransactionDialog: true,
StationCard: {
- emits: ['need-refresh', 'open-authorize', 'open-set-url', 'open-start-tx'],
+ emits: ['open-authorize', 'open-set-url', 'open-start-tx'],
props: ['chargingStation'],
template: `<article class="stub-station-card">
<button class="stub-authorize" @click="$emit('open-authorize', { chargingStationId: 'CS-1', hashId: 'h1' })">auth</button>
await startBtn?.trigger('click')
await flushPromises()
expect(mockClient.startChargingStation).toHaveBeenCalled()
- expect(wrapper.emitted('need-refresh')).toHaveLength(1)
})
it('should label Stop when started, calls stopChargingStation', async () => {