Skip to content

Commit 5f8e99e

Browse files
committed
tests
1 parent 858bc99 commit 5f8e99e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
import { expect } from 'chai';
3+
import { render, screen } from '@mongodb-js/testing-library-compass';
4+
import { DiagramCard } from './diagram-card';
5+
6+
describe('DiagramCard', () => {
7+
const props = {
8+
diagram: {
9+
id: 'test-diagram',
10+
connectionId: 'test-connection',
11+
name: 'Test Diagram',
12+
edits: [],
13+
lastModified: new Date('2025-01-01').getTime(),
14+
databases: 'someDatabase',
15+
},
16+
onOpen: () => {},
17+
onDelete: () => {},
18+
onRename: () => {},
19+
};
20+
21+
it('renders name, database, last edited', () => {
22+
render(<DiagramCard {...props} />);
23+
expect(screen.getByText('Test Diagram')).to.be.visible;
24+
expect(screen.getByText('someDatabase')).to.be.visible;
25+
expect(screen.getByText('Last modified: January 1, 2025')).to.be.visible;
26+
});
27+
});

0 commit comments

Comments
 (0)