overleaf-cep/services/web/test/frontend/components/shared/material-icon.spec.tsx
Alf Eaton 2147f1d53d Remove Bootstrap 3 code from IDE page components (#23061)
GitOrigin-RevId: b41aff10672bf96e892de0be396a69eb25e2443b
2025-03-07 09:05:45 +00:00

30 lines
962 B
TypeScript

import MaterialIcon from '@/shared/components/material-icon'
import unfilledIconTypes from '../../../../frontend/fonts/material-symbols/unfilled-symbols.mjs'
const FONT_SIZE = 40
describe('MaterialIcon', function () {
describe('Filled', function () {
it('contains symbols', function () {
cy.mount(<MaterialIcon type="home" style={{ fontSize: FONT_SIZE }} />)
cy.get('.material-symbols').as('icon')
cy.get('@icon')
.invoke('width')
.should('be.within', FONT_SIZE - 1, FONT_SIZE + 1)
})
})
describe('Unfilled', function () {
it('Contain all unfilled symbol', function () {
for (const type of unfilledIconTypes) {
cy.mount(
<MaterialIcon type={type} unfilled style={{ fontSize: FONT_SIZE }} />
)
cy.get('.material-symbols').as('icon')
cy.get('@icon')
.invoke('width')
.should('be.within', FONT_SIZE - 1, FONT_SIZE + 1)
}
})
})
})