diff --git a/lib/rules/selector-max-id/__tests__/index.js b/lib/rules/selector-max-id/__tests__/index.js index 742f1e65f9..409dcc9c0d 100644 --- a/lib/rules/selector-max-id/__tests__/index.js +++ b/lib/rules/selector-max-id/__tests__/index.js @@ -168,14 +168,6 @@ testRule(rule, { code: "#foo { @media print { #bar {} } }", description: "media query: nested" }, - { - code: "#foo { @if ($p == 1) { #bar {} } }", - description: "@if statement: nested" - }, - { - code: ".foo { @if ($p == 1) { #bar #baz {} } }", - description: "@if statement: nested compound selector" - }, { code: ".foo { @media print { #bar #baz {} } }", description: "@media query: nested compound selector" @@ -227,22 +219,6 @@ testRule(rule, { line: 1, column: 1 }, - { - code: "#foo #bar #baz { @if ($p == 1) { #bar {} } }", - description: - "compound selector: greater than max id selectors, nested @if statement", - message: messages.expected("#foo #bar #baz", 2), - line: 1, - column: 1 - }, - { - code: ".foo { @if ($p == 1) { #bar #baz #foo {} } }", - description: - "nested compound selector: greater than max id selectors, nested @if statement", - message: messages.expected(".foo #bar #baz #foo", 2), - line: 1, - column: 24 - }, { code: ".foo { @media print { #bar #baz #foo {} } }", description: @@ -354,3 +330,40 @@ testRule(rule, { } ] }); + +testRule(rule, { + ruleName, + config: [2], + skipBasicChecks: true, + syntax: "scss", + + accept: [ + { + code: "#foo { @if ($p == 1) { #bar {} } }", + description: "@if statement: nested" + }, + { + code: ".foo { @if ($p == 1) { #bar #baz {} } }", + description: "@if statement: nested compound selector" + } + ], + + reject: [ + { + code: "#foo #bar #baz { @if ($p == 1) { #bar {} } }", + description: + "compound selector: greater than max id selectors, nested @if statement", + message: messages.expected("#foo #bar #baz", 2), + line: 1, + column: 1 + }, + { + code: ".foo { @if ($p == 1) { #bar #baz #foo {} } }", + description: + "nested compound selector: greater than max id selectors, nested @if statement", + message: messages.expected(".foo #bar #baz #foo", 2), + line: 1, + column: 24 + } + ] +});