Skip to content

Commit 6ce9b72

Browse files
Fixed linting issue
Fixed failing test due to timezone
1 parent a4540bb commit 6ce9b72

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

vuu-ui/packages/vuu-utils/test/filters/columnFilterStore.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ vi.mock("../../src/date/date-utils", async () => {
4141
...actual,
4242
Time: (timeString: string) => ({
4343
asDate: vi.fn(() => {
44-
const d = new Date("2025-05-15");
45-
d.setHours(Number(timeString.split(":")[0]));
46-
d.setMinutes(Number(timeString.split(":")[1]));
47-
d.setSeconds(Number(timeString.split(":")[2]));
44+
const d = new Date(`2025-05-15T${timeString}Z`);
4845
return d;
4946
}),
5047
toString: () => timeString,
@@ -101,15 +98,15 @@ describe("ColumnFilterStore", () => {
10198
it("handles time filter with single value", () => {
10299
const store = new ColumnFilterStore();
103100
store.addFilter(lastUpdateDescriptor, "=", "12:34:56");
104-
expect(store.filter).toEqual({ filter: "lastUpdate = 1747308896000" });
101+
expect(store.filter).toEqual({ filter: "lastUpdate = 1747312496000" });
105102
expect(store.columnValues.get("lastUpdate")).toBe("12:34:56");
106103
});
107104

108105
it("handles between operator for time columns", () => {
109106
const store = new ColumnFilterStore();
110107
store.addFilter(lastUpdateDescriptor, "between", ["09:00:00", "10:00:00"]);
111108
expect(store.filter).toEqual({
112-
filter: "lastUpdate >= 1747296000000 and lastUpdate <= 1747299600000",
109+
filter: "lastUpdate >= 1747299600000 and lastUpdate <= 1747303200000",
113110
});
114111
});
115112

@@ -128,7 +125,7 @@ describe("ColumnFilterStore", () => {
128125
filter: 'lastUpdate >= "09:00:00" and lastUpdate <= "10:00:00"',
129126
};
130127
expect(store.filter).toEqual({
131-
filter: "lastUpdate >= 1747296000000 and lastUpdate <= 1747299600000",
128+
filter: "lastUpdate >= 1747299600000 and lastUpdate <= 1747303200000",
132129
});
133130
});
134131

vuu-ui/sample-apps/app-vuu-example/src/order-management/cancel-confirm-prompt/ConfirmSelectionPanel.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ export const ConfirmSelectionPanel = ({
1616
<div className={classBase}>
1717
<Table
1818
allowDragColumnHeader={false}
19-
config={{ columns: dataSource.columns.map(toColumnDescriptor) }}
19+
config={{
20+
columns: dataSource.columns.map((col) => toColumnDescriptor(col)),
21+
}}
2022
dataSource={dataSource}
2123
height={380}
2224
width={600}

0 commit comments

Comments
 (0)