@@ -5,6 +5,7 @@ import makeRouter from "@/router";
5
5
import { createTestingPinia } from "@pinia/testing" ;
6
6
import { MessageStore } from "@/stores/MessageStore" ;
7
7
import { MessageStatus } from "@/resources/Message" ;
8
+ import { toLocalDateTimeString } from "@/composables/formatUtils" ;
8
9
9
10
//Defines a domain-specific language (DSL) for interacting with the system under test (sut)
10
11
interface componentDSL {
@@ -158,19 +159,18 @@ describe("Feature: 3 Visual Representation of Saga Timeline", () => {
158
159
} ) ;
159
160
160
161
//assert
161
-
162
162
componentDriver . assert . thereAreTheFollowingSagaChangesInThisOrder ( [
163
163
{
164
- expectedRenderedLocalTime : "3/28/2025 3:04:05 AM" ,
164
+ expectedRenderedLocalTime : toLocalDateTimeString ( sampleSagaHistory . changes [ 3 ] . start_time ) , // D
165
165
} ,
166
166
{
167
- expectedRenderedLocalTime : "3/28/2025 3:04:06 AM" ,
167
+ expectedRenderedLocalTime : toLocalDateTimeString ( sampleSagaHistory . changes [ 2 ] . start_time ) , // C
168
168
} ,
169
169
{
170
- expectedRenderedLocalTime : "3/28/2025 3:04:07 AM" ,
170
+ expectedRenderedLocalTime : toLocalDateTimeString ( sampleSagaHistory . changes [ 1 ] . start_time ) , // B
171
171
} ,
172
172
{
173
- expectedRenderedLocalTime : "3/28/2025 3:04:08 AM" ,
173
+ expectedRenderedLocalTime : toLocalDateTimeString ( sampleSagaHistory . changes [ 0 ] . start_time ) , // A
174
174
} ,
175
175
] ) ;
176
176
} ) ;
@@ -224,16 +224,16 @@ describe("Feature: 3 Visual Representation of Saga Timeline", () => {
224
224
225
225
componentDriver . assert . thereAreTheFollowingSagaChangesInThisOrder ( [
226
226
{
227
- expectedRenderedLocalTime : "3/27/2025 8:04:05 PM" ,
227
+ expectedRenderedLocalTime : toLocalDateTimeString ( sampleSagaHistory . changes [ 3 ] . start_time ) , // D
228
228
} ,
229
229
{
230
- expectedRenderedLocalTime : "3/27/2025 8:04:06 PM" ,
230
+ expectedRenderedLocalTime : toLocalDateTimeString ( sampleSagaHistory . changes [ 2 ] . start_time ) , // C
231
231
} ,
232
232
{
233
- expectedRenderedLocalTime : "3/27/2025 8:04:07 PM" ,
233
+ expectedRenderedLocalTime : toLocalDateTimeString ( sampleSagaHistory . changes [ 1 ] . start_time ) , // B
234
234
} ,
235
235
{
236
- expectedRenderedLocalTime : "3/27/2025 8:04:08 PM" ,
236
+ expectedRenderedLocalTime : toLocalDateTimeString ( sampleSagaHistory . changes [ 0 ] . start_time ) , // A
237
237
} ,
238
238
] ) ;
239
239
} ) ;
@@ -322,14 +322,15 @@ function rendercomponent({ initialState = {} }: { initialState?: { MessageStore?
322
322
const sagaChangesContainer = screen . getByRole ( "table" , { name : / s a g a - s e q u e n c e - l i s t / i } ) ;
323
323
324
324
const sagaUpdatesElements = within ( sagaChangesContainer ) . queryAllByRole ( "row" ) ;
325
- //from within each sagaUpdatesElemtns get the values of an element with aria-label="time stamp"
325
+ //from within each sagaUpdatesElements get the values of an element with aria-label="time stamp"
326
326
//and check if the values are in the same order as the sagaUpdates array passed to this function
327
327
const sagaUpdatesTimestamps = sagaUpdatesElements . map ( ( item : HTMLElement ) => within ( item ) . getByLabelText ( "time stamp" ) ) ;
328
328
329
329
//expect the number of found sagaUpdatesTimestamps to be the same as the number of sagaUpdates passed to this function
330
330
expect ( sagaUpdatesTimestamps ) . toHaveLength ( sagaUpdates . length ) ;
331
331
332
332
const sagaUpdatesTimestampsValues = sagaUpdatesTimestamps . map ( ( item ) => item . innerHTML ) ;
333
+
333
334
// //check if the values are in the same order as the sagaUpdates array passed to this function
334
335
expect ( sagaUpdatesTimestampsValues ) . toEqual ( sagaUpdates . map ( ( item ) => item . expectedRenderedLocalTime ) ) ;
335
336
} ,
0 commit comments