diff --git a/__tests__/src/rules/no-static-element-interactions-test.js b/__tests__/src/rules/no-static-element-interactions-test.js index 7cc1a937a..fb6cb2d1e 100644 --- a/__tests__/src/rules/no-static-element-interactions-test.js +++ b/__tests__/src/rules/no-static-element-interactions-test.js @@ -429,11 +429,26 @@ ruleTester.run(`${ruleName}:recommended`, rule, { // Expressions should pass in recommended mode { code: '
{}} />;' }, { code: '
this.handleKeyPress(e)}>{this.props.children}
' }, + // Cases for allowExpressionValues set to true + { + code: '
{}} />;', + options: [{ allowExpressionValues: true }], + }, // Specific case for ternary operator with literals on both side { code: '
{}} />;', options: [{ allowExpressionValues: true }], }, + { + code: '
{}} />;', + options: [{ allowExpressionValues: true }], + errors: [expectedError], + }, + { + code: '
{}} />;', + options: [{ allowExpressionValues: true }], + errors: [expectedError], + }, ) .map(ruleOptionsMapperFactory(recommendedOptions)) .map(parserOptionsMapper), @@ -470,6 +485,12 @@ ruleTester.run(`${ruleName}:strict`, rule, { // Expressions should fail in strict mode { code: '
{}} />;', errors: [expectedError] }, { code: '
this.handleKeyPress(e)}>{this.props.children}
', errors: [expectedError] }, + // Cases for allowExpressionValues set to false + { + code: '
{}} />;', + options: [{ allowExpressionValues: false }], + errors: [expectedError], + }, // Specific case for ternary operator with literals on both side { code: '
{}} />;',