From 7fc2cbc45be3ffd88f48807dedbdb1f5ee049438 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Mon, 19 Jan 2026 20:16:06 -0600 Subject: [PATCH] tests: Fixed frontend tests failing after datetime utility changes. --- .../cards/__tests__/StreamConnectionCardUtils.test.js | 4 ++-- .../cards/__tests__/VodConnectionCardUtils.test.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/utils/cards/__tests__/StreamConnectionCardUtils.test.js b/frontend/src/utils/cards/__tests__/StreamConnectionCardUtils.test.js index 92c028c9..a1596280 100644 --- a/frontend/src/utils/cards/__tests__/StreamConnectionCardUtils.test.js +++ b/frontend/src/utils/cards/__tests__/StreamConnectionCardUtils.test.js @@ -167,11 +167,11 @@ describe('StreamConnectionCardUtils', () => { dateTimeUtils.subtract.mockReturnValue(mockConnectedTime); dateTimeUtils.format.mockReturnValue('01/01/2024 10:00:00'); - const accessor = StreamConnectionCardUtils.connectedAccessor('MM/DD/YYYY'); + const accessor = StreamConnectionCardUtils.connectedAccessor('MM/DD/YYYY, HH:mm:ss'); const result = accessor({ connected_since: 7200 }); expect(dateTimeUtils.subtract).toHaveBeenCalledWith(mockNow, 7200, 'second'); - expect(dateTimeUtils.format).toHaveBeenCalledWith(mockConnectedTime, 'MM/DD/YYYY HH:mm:ss'); + expect(dateTimeUtils.format).toHaveBeenCalledWith(mockConnectedTime, 'MM/DD/YYYY, HH:mm:ss'); expect(result).toBe('01/01/2024 10:00:00'); }); diff --git a/frontend/src/utils/cards/__tests__/VodConnectionCardUtils.test.js b/frontend/src/utils/cards/__tests__/VodConnectionCardUtils.test.js index 9765daf3..19b71a9d 100644 --- a/frontend/src/utils/cards/__tests__/VodConnectionCardUtils.test.js +++ b/frontend/src/utils/cards/__tests__/VodConnectionCardUtils.test.js @@ -279,9 +279,9 @@ describe('VodConnectionCardUtils', () => { dateTimeUtils.format.mockReturnValue('01/15/2024 14:30:00'); const connection = { connected_at: 1705329000 }; - const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY'); + const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY, HH:mm:ss'); - expect(dateTimeUtils.format).toHaveBeenCalledWith(1705329000000, 'MM/DD/YYYY HH:mm:ss'); + expect(dateTimeUtils.format).toHaveBeenCalledWith(1705329000000, 'MM/DD/YYYY, HH:mm:ss'); expect(result).toBe('01/15/2024 14:30:00'); }); @@ -289,15 +289,15 @@ describe('VodConnectionCardUtils', () => { dateTimeUtils.format.mockReturnValue('01/15/2024 13:00:00'); const connection = { client_id: 'vod_1705323600000_abc' }; - const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY'); + const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY, HH:mm:ss'); - expect(dateTimeUtils.format).toHaveBeenCalledWith(1705323600000, 'MM/DD/YYYY HH:mm:ss'); + expect(dateTimeUtils.format).toHaveBeenCalledWith(1705323600000, 'MM/DD/YYYY, HH:mm:ss'); expect(result).toBe('01/15/2024 13:00:00'); }); it('should return Unknown when no timestamp data available', () => { const connection = {}; - const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY'); + const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY, HH:mm:ss'); expect(result).toBe('Unknown'); });