Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(cdk:forms): update disabled case #1506

Merged
merged 1 commit into from
Mar 22, 2023
Merged

Conversation

danranVm
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

What is the current behavior?

What is the new behavior?

Other information

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)
})
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with code review

  1. In the line 334, it is better to use the variable instead of hard coding the value 'disable'.
  2. In line 337, it is better to use the variable instead of hard coding the value 'enabled'.
  3. In line 341, it is better to use the variable instead of hard coding the value 'disabled'.
  4. In line 345, it is better to check if the control has been set disabled before checking its value.
  5. In line 349, it is better to check if the control has been set enabled before checking its value.
  6. The code should have proper comments which can help to understand the code more easily.

@idux-bot
Copy link

idux-bot bot commented Mar 21, 2023

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Merging #1506 (36f88f4) into main (2d74862) will not change coverage.
The diff coverage is n/a.

❗ Current head 36f88f4 differs from pull request most recent head 767e72e. Consider uploading reports for the commit 767e72e to get more accurate results

@@           Coverage Diff           @@
##             main    #1506   +/-   ##
=======================================
  Coverage   92.75%   92.75%           
=======================================
  Files         331      331           
  Lines       30801    30801           
  Branches     3532     3533    +1     
=======================================
  Hits        28568    28568           
  Misses       2233     2233           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@danranVm danranVm merged commit 703122f into IDuxFE:main Mar 22, 2023
@danranVm danranVm deleted the fix-cdk-forms branch April 12, 2023 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant