Skip to content

Commit

Permalink
test(cdk:forms): update disabled case (#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
danranVm committed Mar 22, 2023
1 parent 2d74862 commit 703122f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cdk/forms/__tests__/abstractControl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,20 @@ describe('abstractControl.ts', () => {

expect(await control.validate()).toEqual({ required: getError('required', control) })

control.setValue('disable')
control.setValue('enabled')
await flushPromises()

expect(control.disabled.value).toEqual(false)
expect(control.valid.value).toEqual(false)
expect(await control.validate()).toEqual({
maxLength: getError('maxLength', control, { actual: 7, isArray: false, maxLength: 5 }),
})

control.setValue('disabled')
await flushPromises()

expect(control.disabled.value).toEqual(true)
expect(control.valid.value).toEqual(true)
expect(await control.validate()).toEqual(undefined)
})
})
Expand Down

0 comments on commit 703122f

Please sign in to comment.