Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix unit test

Fendy Heryantoff833500b761
diff --git a/packages/nocodb/tests/unit/rest/tests/dataApiV3/filter.test.ts b/packages/nocodb/tests/unit/rest/tests/dataApiV3/filter.test.ts
index 6586bad2f7..2929689e9f 100644
--- a/packages/nocodb/tests/unit/rest/tests/dataApiV3/filter.test.ts
+++ b/packages/nocodb/tests/unit/rest/tests/dataApiV3/filter.test.ts
@@ -16,8 +16,11 @@ describe('dataApiV3', () => {
let urlPrefix: string;
let ncAxiosGet: INcAxios['ncAxiosGet'];
let ncAxiosPost: INcAxios['ncAxiosPost'];
+ let systemTz: string = 'Etc/Utc';
beforeEach(async () => {
+ systemTz = process.env.TZ || systemTz;
+ process.env.TZ = 'Etc/Utc';
testContext = await dataApiV3BeforeEach();
testAxios = ncAxios(testContext);
urlPrefix = `/api/${API_VERSION}/data/${testContext.base.id}`;
@@ -25,6 +28,10 @@ describe('dataApiV3', () => {
ncAxiosPost = testAxios.ncAxiosPost;
});
+ afterEach(() => {
+ process.env.TZ = systemTz;
+ });
+
it('should filter eq by exactDate with IST timezone', async function () {
// Create table with Date column (IST timezone)
const table = await createTable(testContext.context, testContext.base, {
@@ -101,7 +108,7 @@ describe('dataApiV3', () => {
expect(filterResponse.body.records[0].fields.Date).to.eq('2026-01-15');
});
- it.only('should filter gte by exactDate with IST timezone', async function () {
+ it('should filter gte by exactDate with IST timezone', async function () {
// Create table with Date column (IST timezone)
const table = await createTable(testContext.context, testContext.base, {
table_name: 'dateFilterTest',