silverwolf-x/project / test /unit /getDisplayName.test.ts
silverwolf-x's picture
download
raw
832 Bytes
/* eslint-env jest */
import { Component } from 'react'
import { getDisplayName } from 'next/dist/shared/lib/utils'
describe('getDisplayName', () => {
it('gets the proper display name of a component', () => {
class ComponentOne extends Component {
render() {
return null
}
}
class ComponentTwo extends Component {
static displayName = 'CustomDisplayName'
render() {
return null
}
}
function FunctionalComponent() {
return null
}
expect(getDisplayName(ComponentOne)).toBe('ComponentOne')
expect(getDisplayName(ComponentTwo)).toBe('CustomDisplayName')
expect(getDisplayName(FunctionalComponent)).toBe('FunctionalComponent')
expect(getDisplayName(() => null)).toBe('Unknown')
expect(getDisplayName('div' as any)).toBe('div')
})
})

Xet Storage Details

Size:
832 Bytes
·
Xet hash:
90207ee37688a03f884465ec0240b24ac0d0deb6e133b7610d6c66cd1cf8edbe

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.