Skip to content

Commit

Permalink
Merge branch 'main' into fix/issue-1259
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch88 committed Jan 3, 2024
2 parents a184152 + b5ccbbb commit ee41750
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/components/src/utils/mask/types/mask-date.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MaskClipboardContext, MaskClipboardContextEvent, MaskFocusContext, Mask
import { DateMask } from './mask-date'

describe('MaskComponentAdapter', () => {
const todayYear = new Date().getFullYear()
let mask = new DateMask()
let component = new MaskComponentMock()

Expand All @@ -15,7 +16,7 @@ describe('MaskComponentAdapter', () => {
describe('onParseValue', () => {
test('should parse value', () => {
expect(mask.onParseValue()).toBe('')
expect(mask.onParseValue('1.1')).toBe('2023-01-01')
expect(mask.onParseValue('1.1')).toBe(todayYear + '-01-01')
})
})
describe('onFormatValue', () => {
Expand Down Expand Up @@ -45,7 +46,8 @@ describe('MaskComponentAdapter', () => {

mask.onBlur(context)

expect(context.value).toBe('01.01.2023')
const todayYear = new Date().getFullYear()
expect(context.value).toBe('01.01.' + todayYear)
expect(context.position.value).toBe(10)
})
})
Expand Down

0 comments on commit ee41750

Please sign in to comment.