/** * @fileoverview Enforce label tags have an associated control. * @author Jesse Beach */ // ----------------------------------------------------------------------------- // Requirements // ----------------------------------------------------------------------------- import { RuleTester } from 'eslint'; import parserOptionsMapper from '../../__util__/parserOptionsMapper'; import parsers from '../../__util__/helpers/parsers'; import rule from '../../../src/rules/label-has-associated-control'; import ruleOptionsMapperFactory from '../../__util__/ruleOptionsMapperFactory'; // ----------------------------------------------------------------------------- // Tests // ----------------------------------------------------------------------------- const ruleTester = new RuleTester(); const ruleName = 'label-has-associated-control'; const expectedError = { message: 'A form label must be associated with a control.', type: 'JSXOpeningElement', }; const componentsSettings = { 'jsx-a11y': { components: { CustomInput: 'input', CustomLabel: 'label', }, }, }; const htmlForValid = [ { code: '', options: [{ depth: 4 }] }, { code: '