Replace disabled attribute assertion with relaxed one
What does this MR do and why?
This MR does 3 following things:
- adds eslint rule to complain about using
expect(something.attributes('disabled')).toBe('true')
- rule triggers - using
.attributes('disabled')
and.toBe('ANY_STRING_LITERAL')
- rule triggers - using
- fixes all offenses by using regexp search & replace
-
\.attributes\('disabled'\)\)\.toBe\('[^']+'\)
▶ .attributes('disabled')).toBeDefined()
-
\.attributes\('disabled'\)\)\.not.toBe\('[^']+'\)
▶ .attributes('disabled')).toBeUndefined()
-
This is required because Vue.js 3 no more does some dirty attributes magic, so let's stick to HTML behaviour
How to set up and validate locally
- checkout
- run
yarn jest
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Illya Klymov