Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ describe('DiagramCard', () => {
id: 'test-diagram',
connectionId: 'test-connection',
name: 'Test Diagram',
createdAt: '2023-10-01T00:00:00.000Z',
updatedAt: '2023-10-03T00:00:00.000Z',
createdAt: '2021-10-01T00:00:00.000Z',
updatedAt: '2023-10-03T00:00:00.000',
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ISO timestamp is missing the Z timezone designator, which may cause inconsistent parsing across environments; consider restoring the trailing Z for a fully qualified UTC time string.

Suggested change
updatedAt: '2023-10-03T00:00:00.000',
updatedAt: '2023-10-03T00:00:00.000Z',

Copilot uses AI. Check for mistakes.
Copy link
Member Author

@Anemy Anemy Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We render it based on the user's time zone so the change here is making it less brittle.

We could change what we're looking for in the check to be on of two days if we want, or something else entirely, I don't think it's worth spending too much time on.

Copy link
Collaborator

@paula-stacho paula-stacho Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting.. maybe we could fix the timezone for the tests? So that we don't need to think about this for future tests, since it's apparently easy to miss for us Europeans 😅
I couldn't find a mocha setting but we could change the npm scripts to: "test": "TZ=UTC mocha",.

edits: [
{
id: 'edit-id',
timestamp: '2023-10-01T00:00:00.000Z',
timestamp: '2022-10-01T00:00:00.000Z',
type: 'SetModel',
model: {
collections: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React, {
useState,
} from 'react';
import { connect } from 'react-redux';
import toNS from 'mongodb-ns';
import type { MongoDBJSONSchema } from 'mongodb-schema';
import type { DataModelingState } from '../store/reducer';
import {
Expand Down Expand Up @@ -235,7 +236,7 @@ const DiagramEditor: React.FunctionComponent<{
x: coll.displayPosition[0],
y: coll.displayPosition[1],
},
title: coll.ns,
title: toNS(coll.ns).collection,
fields: getFieldsFromSchema(coll.jsonSchema),
})
);
Expand Down
Loading