Skip to content

Replace disabled attribute assertion with relaxed one

Illya Klymov requested to merge xanf-unify-literal-disabled into master

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')
  • 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.

Edited by Illya Klymov

Merge request reports