Skip to content

Commit b4a6953

Browse files
update test
1 parent 8b9883c commit b4a6953

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

tests/lib/rules/v-if-else-key.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ tester.run('v-if-else-key', rule, {
515515
<template>
516516
<div>
517517
<ComponentA v-if="foo" />
518+
<ComponentA v-else />
518519
519520
<ComponentA v-if="bar" />
520521
<ComponentA v-else-if="baz" />
@@ -532,11 +533,12 @@ tester.run('v-if-else-key', rule, {
532533
output: `
533534
<template>
534535
<div>
535-
<ComponentA v-if="foo" />
536+
<ComponentA key="component-a-1" v-if="foo" />
537+
<ComponentA key="component-a-2" v-else />
536538
537-
<ComponentA key="component-a-1" v-if="bar" />
538-
<ComponentA key="component-a-2" v-else-if="baz" />
539-
<ComponentA key="component-a-3" v-else />
539+
<ComponentA v-if="bar" />
540+
<ComponentA key="component-a-4" v-else-if="baz" />
541+
<ComponentA key="component-a-5" v-else />
540542
</div>
541543
</template>
542544
<script>
@@ -551,17 +553,22 @@ tester.run('v-if-else-key', rule, {
551553
{
552554
message:
553555
"Conditionally rendered repeated component 'ComponentA' expected to have a 'key' attribute.",
554-
line: 6
556+
line: 4
555557
},
556558
{
557559
message:
558560
"Conditionally rendered repeated component 'ComponentA' expected to have a 'key' attribute.",
559-
line: 7
561+
line: 5
560562
},
561563
{
562564
message:
563565
"Conditionally rendered repeated component 'ComponentA' expected to have a 'key' attribute.",
564566
line: 8
567+
},
568+
{
569+
message:
570+
"Conditionally rendered repeated component 'ComponentA' expected to have a 'key' attribute.",
571+
line: 9
565572
}
566573
]
567574
}

0 commit comments

Comments
 (0)