Skip to content

Commit d200917

Browse files
committed
test: add component test for UUIDTag
1 parent c40c5ab commit d200917

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/components/common/UUIDTag.cy.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import UUIDTag from './UUIDTag';
2+
3+
describe('UUIDTag', () => {
4+
beforeEach(() => {
5+
cy.viewport(500, 500);
6+
});
7+
8+
it('renders correctly with a valid UUID string', () => {
9+
const testId = '12345678';
10+
cy.mount(<UUIDTag uuid={testId} />);
11+
cy.contains('1234...5678').should('exist');
12+
});
13+
14+
it('handles non-string UUID values gracefully', () => {
15+
const testIdNonString = 12345678;
16+
cy.mount(<UUIDTag uuid={testIdNonString} />);
17+
cy.contains('1234...5678').should('exist');
18+
});
19+
20+
it('displays a fallback for undefined UUID', () => {
21+
cy.mount(<UUIDTag uuid={undefined} />);
22+
cy.contains('...').should('exist');
23+
});
24+
});

0 commit comments

Comments
 (0)