Skip to content

Commit

Permalink
front: add track check to output and input timestops table e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alice Khoudli <[email protected]>
  • Loading branch information
Synar committed Nov 28, 2024
1 parent bf75f77 commit 9e66625
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 13 deletions.
12 changes: 7 additions & 5 deletions front/src/modules/timesStops/hooks/useTimeStopsColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ export const useTimeStopsColumns = <T extends TimeStopsRow>(
{
...keyColumn('trackName', createTextColumn()),
title: t('trackName'),
component: ({ rowData }) => (
<span title={rowData.trackName} className="ml-2 text-nowrap overflow-hidden">
{rowData.trackName}
</span>
),
...(isOutputTable && {
component: ({ rowData }) => (
<span title={rowData.trackName} className="ml-2 text-nowrap overflow-hidden">
{rowData.trackName}
</span>
),
}),
disabled: true,
...fixedWidth(70),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"stationName": "West_station",
"stationCh": "BV",
"trackName": "V2",
"requestedArrival": "11:22:40",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -18,6 +19,7 @@
{
"stationName": "Mid_West_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -34,6 +36,7 @@
{
"stationName": "Mid_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "124",
Expand All @@ -50,6 +53,7 @@
{
"stationName": "South_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"stationName": "West_station",
"stationCh": "BV",
"trackName": "V2",
"requestedArrival": "11:22:40",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -18,6 +19,7 @@
{
"stationName": "Mid_West_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -34,6 +36,7 @@
{
"stationName": "Mid_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "124",
Expand All @@ -50,6 +53,7 @@
{
"stationName": "South_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"stationName": "West_station",
"stationCh": "BV",
"trackName": "V2",
"requestedArrival": "11:22:40",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -18,6 +19,7 @@
{
"stationName": "Mid_West_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -34,6 +36,7 @@
{
"stationName": "Mid_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "124",
Expand All @@ -50,6 +53,7 @@
{
"stationName": "South_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"stationName": "West_station",
"stationCh": "BV",
"trackName": "V2",
"requestedArrival": "11:22:40",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -18,6 +19,7 @@
{
"stationName": "Mid_West_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -34,6 +36,7 @@
{
"stationName": "Mid_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "124",
Expand All @@ -50,6 +53,7 @@
{
"stationName": "South_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"stationName": "West_station",
"stationCh": "BV",
"trackName": "V2",
"requestedArrival": "11:22:40",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -18,6 +19,7 @@
{
"stationName": "Mid_West_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -34,6 +36,7 @@
{
"stationName": "Mid_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "124",
Expand All @@ -50,6 +53,7 @@
{
"stationName": "South_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"stationName": "West_station",
"stationCh": "BV",
"trackName": "V2",
"requestedArrival": "11:22:40",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -18,6 +19,7 @@
{
"stationName": "Mid_West_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -34,6 +36,7 @@
{
"stationName": "Mid_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "124",
Expand All @@ -50,6 +53,7 @@
{
"stationName": "South_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"stationName": "West_station",
"stationCh": "BV",
"trackName": "V2",
"requestedArrival": "11:22:40",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -18,6 +19,7 @@
{
"stationName": "Mid_West_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -34,6 +36,7 @@
{
"stationName": "Mid_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "124",
Expand All @@ -50,6 +53,7 @@
{
"stationName": "South_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"row": 1,
"values": ["West_station", "BV", "11:22:40", "", "", "5%"]
"values": ["West_station", "BV", "V2", "11:22:40", "", "", "5%"]
},
{
"row": 2,
"values": ["Mid_West_station", "BV", "11:47:40", "300", "11:52:40", "1min/100km"]
"values": ["Mid_West_station", "BV", "V1", "11:47:40", "300", "11:52:40", "1min/100km"]
},
{
"row": 3,
"values": ["Mid_East_station", "BV", "12:05:21", "124", "12:07:25", ""]
"values": ["Mid_East_station", "BV", "V1", "12:05:21", "124", "12:07:25", ""]
},
{
"row": 4,
"values": ["North_East_station", "BV", "", "0", "", ""]
"values": ["North_East_station", "BV", "V2", "", "0", "", ""]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"stationName": "West_station",
"stationCh": "BV",
"trackName": "V2",
"requestedArrival": "11:22:40",
"requestedDeparture": "",
"stopTime": "",
Expand All @@ -18,6 +19,7 @@
{
"stationName": "Mid_West_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "11:47:40",
"requestedDeparture": "11:52:40",
"stopTime": "300",
Expand All @@ -35,6 +37,7 @@
{
"stationName": "Mid_East_station",
"stationCh": "BV",
"trackName": "V1",
"requestedArrival": "12:05:21",
"requestedDeparture": "12:07:25",
"stopTime": "124",
Expand All @@ -51,6 +54,7 @@
{
"stationName": "North_East_station",
"stationCh": "BV",
"trackName": "V2",
"requestedArrival": "",
"requestedDeparture": "",
"stopTime": "0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"row": 1,
"values": ["West_station", "BV", "11:22:40", "", "", "3%"]
"values": ["West_station", "BV", "V2", "11:22:40", "", "", "3%"]
},
{
"row": 2,
"values": ["Mid_West_station", "BV", "", "", "", ""]
"values": ["Mid_West_station", "BV", "V1", "", "", "", ""]
},
{
"row": 3,
"values": ["Mid_East_station", "BV", "13:58:19", "21", "13:58:40", ""]
"values": ["Mid_East_station", "BV", "V1", "13:58:19", "21", "13:58:40", ""]
},
{
"row": 4,
"values": ["North_East_station", "BV", "", "0", "", ""]
"values": ["North_East_station", "BV", "V2", "", "0", "", ""]
}
]
6 changes: 6 additions & 0 deletions front/tests/pages/op-output-table-page-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class OperationalStudiesOutputTablePage extends OperationalStudiesTimetablePage
const [
stationName,
stationCh,
trackName,
requestedArrival,
requestedDeparture,
stopTime,
Expand All @@ -70,6 +71,10 @@ class OperationalStudiesOutputTablePage extends OperationalStudiesTimetablePage
false
),
OperationalStudiesOutputTablePage.getCellValue(cells.nth(headerIndexMap[translations.ch])),
OperationalStudiesOutputTablePage.getCellValue(
cells.nth(headerIndexMap[translations.trackName]),
false
),
OperationalStudiesOutputTablePage.getCellValue(
cells.nth(headerIndexMap[translations.arrivalTime]),
false
Expand Down Expand Up @@ -114,6 +119,7 @@ class OperationalStudiesOutputTablePage extends OperationalStudiesTimetablePage
actualTableData.push({
stationName,
stationCh,
trackName,
requestedArrival,
requestedDeparture,
stopTime,
Expand Down
2 changes: 2 additions & 0 deletions front/tests/utils/dataNormalizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface Margin {
export interface StationData {
stationName: string;
stationCh: string;
trackName: string;
requestedArrival: string;
requestedDeparture: string;
stopTime: string;
Expand Down Expand Up @@ -58,6 +59,7 @@ export function normalizeData(data: StationData[]): StationData[] {
return data.map((item) => ({
stationName: cleanWhitespace(item.stationName),
stationCh: cleanWhitespace(item.stationCh),
trackName: cleanWhitespace(item.trackName),
requestedArrival: cleanWhitespace(item.requestedArrival),
requestedDeparture: cleanWhitespace(item.requestedDeparture),
stopTime: cleanWhitespace(item.stopTime),
Expand Down

0 comments on commit 9e66625

Please sign in to comment.