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:
@@ -27,8 +27,19 @@ ruleTester.run('require-v2-layout-meta', rule, {
|
||||
filename: 'src/pages/dashboard.vue',
|
||||
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: [
|
||||
{
|
||||
// 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',
|
||||
code: '<script setup lang="ts">const x = 1</script><template><div/></template>',
|
||||
|
||||
Reference in New Issue
Block a user