tldraw/__tests__/dashes.test.ts

35 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-07-01 22:11:09 +00:00
import { DashStyle } from 'types'
import { getPerfectDashProps } from 'utils'
2021-06-22 18:13:16 +00:00
describe('ellipse dash props', () => {
it('renders dashed props on a circle correctly', () => {
2021-07-01 22:11:09 +00:00
expect(getPerfectDashProps(100, 4, DashStyle.Dashed)).toMatchSnapshot(
2021-06-22 18:13:16 +00:00
'small dashed circle dash props'
)
2021-07-01 22:11:09 +00:00
expect(getPerfectDashProps(100, 4, DashStyle.Dashed)).toMatchSnapshot(
2021-06-22 18:13:16 +00:00
'small dashed ellipse dash props'
)
2021-07-01 22:11:09 +00:00
expect(getPerfectDashProps(200, 8, DashStyle.Dashed)).toMatchSnapshot(
2021-06-22 18:13:16 +00:00
'large dashed circle dash props'
)
2021-07-01 22:11:09 +00:00
expect(getPerfectDashProps(200, 8, DashStyle.Dashed)).toMatchSnapshot(
2021-06-22 18:13:16 +00:00
'large dashed ellipse dash props'
)
})
it('renders dotted props on a circle correctly', () => {
2021-07-01 22:11:09 +00:00
expect(getPerfectDashProps(100, 4, DashStyle.Dotted)).toMatchSnapshot(
2021-06-22 18:13:16 +00:00
'small dotted circle dash props'
)
2021-07-01 22:11:09 +00:00
expect(getPerfectDashProps(100, 4, DashStyle.Dotted)).toMatchSnapshot(
2021-06-22 18:13:16 +00:00
'small dotted ellipse dash props'
)
2021-07-01 22:11:09 +00:00
expect(getPerfectDashProps(200, 8, DashStyle.Dotted)).toMatchSnapshot(
2021-06-22 18:13:16 +00:00
'large dotted circle dash props'
)
2021-07-01 22:11:09 +00:00
expect(getPerfectDashProps(200, 8, DashStyle.Dotted)).toMatchSnapshot(
2021-06-22 18:13:16 +00:00
'large dotted ellipse dash props'
)
})
})