test(lint): cover the PortalLayoutV2 branch of require-v2-layout-meta

Adds a valid case (PortalLayoutV2 under pages-v2/portal) and an invalid
case (OrganizerLayoutV2 under pages-v2/portal -> wrongLayout) so the
rule's portal-path branch has positive + negative coverage. Closes the
Task 5 code-review Important finding.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 11:35:25 +02:00
parent 93e4fe398b
commit 9754d26e07

View File

@@ -27,8 +27,19 @@ ruleTester.run('require-v2-layout-meta', rule, {
filename: 'src/pages/dashboard.vue', filename: 'src/pages/dashboard.vue',
code: '<script setup lang="ts">const x = 1</script><template><div/></template>', code: '<script setup lang="ts">const x = 1</script><template><div/></template>',
}, },
{
// pages-v2/portal/** expects PortalLayoutV2, not OrganizerLayoutV2
filename: 'src/pages-v2/portal/artists.vue',
code: '<script setup lang="ts">definePage({ meta: { layout: \'PortalLayoutV2\' } })</script><template><div/></template>',
},
], ],
invalid: [ invalid: [
{
// OrganizerLayoutV2 is wrong under the portal subtree
filename: 'src/pages-v2/portal/artists.vue',
code: '<script setup lang="ts">definePage({ meta: { layout: \'OrganizerLayoutV2\' } })</script><template><div/></template>',
errors: [{ messageId: 'wrongLayout' }],
},
{ {
filename: 'src/pages-v2/dashboard.vue', filename: 'src/pages-v2/dashboard.vue',
code: '<script setup lang="ts">const x = 1</script><template><div/></template>', code: '<script setup lang="ts">const x = 1</script><template><div/></template>',