-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add component test for UUIDTag
- Loading branch information
1 parent
c40c5ab
commit d200917
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import UUIDTag from './UUIDTag'; | ||
|
||
describe('UUIDTag', () => { | ||
beforeEach(() => { | ||
cy.viewport(500, 500); | ||
}); | ||
|
||
it('renders correctly with a valid UUID string', () => { | ||
const testId = '12345678'; | ||
cy.mount(<UUIDTag uuid={testId} />); | ||
cy.contains('1234...5678').should('exist'); | ||
}); | ||
|
||
it('handles non-string UUID values gracefully', () => { | ||
const testIdNonString = 12345678; | ||
cy.mount(<UUIDTag uuid={testIdNonString} />); | ||
cy.contains('1234...5678').should('exist'); | ||
}); | ||
|
||
it('displays a fallback for undefined UUID', () => { | ||
cy.mount(<UUIDTag uuid={undefined} />); | ||
cy.contains('...').should('exist'); | ||
}); | ||
}); |