material-icon.spec.tsx 997 B

12345678910111213141516171819202122232425262728293031
  1. import MaterialIcon from '@/shared/components/material-icon'
  2. import unfilledIconTypes from '../../../../frontend/fonts/material-symbols/unfilled-symbols.mjs'
  3. import '../../helpers/bootstrap-3'
  4. const FONT_SIZE = 40
  5. describe('MaterialIcon', function () {
  6. describe('Filled', function () {
  7. it('contains symbols', function () {
  8. cy.mount(<MaterialIcon type="home" style={{ fontSize: FONT_SIZE }} />)
  9. cy.get('.material-symbols').as('icon')
  10. cy.get('@icon')
  11. .invoke('width')
  12. .should('be.within', FONT_SIZE - 1, FONT_SIZE + 1)
  13. })
  14. })
  15. describe('Unfilled', function () {
  16. it('Contain all unfilled symbol', function () {
  17. for (const type of unfilledIconTypes) {
  18. cy.mount(
  19. <MaterialIcon type={type} unfilled style={{ fontSize: FONT_SIZE }} />
  20. )
  21. cy.get('.material-symbols').as('icon')
  22. cy.get('@icon')
  23. .invoke('width')
  24. .should('be.within', FONT_SIZE - 1, FONT_SIZE + 1)
  25. }
  26. })
  27. })
  28. })