Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion layers/registry/app/components/SkillDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,7 @@ useHead(computed(() => ({
>
<SkillBehaviors
v-if="data.raw || behaviors.length"
:behaviors="data.sourceFacts.behaviors"
:behaviors="data.sourceFacts.behaviors ?? null"
:readings="behaviorReadings"
/>
<SkillThirdPartyChecks
Expand Down
13 changes: 13 additions & 0 deletions test/unit/skill-detail-duplicate-canonical-path.nuxt.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { mockNuxtImport, mountSuspended } from '@nuxt/test-utils/runtime'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { reactive, ref } from 'vue'
import SkillBehaviors from '../../layers/registry/app/components/_SkillBehaviors.vue'

const route = reactive({
path: '/gh/mirror/multi/shared-skill',
Expand Down Expand Up @@ -216,4 +217,16 @@ describe('skillDetail duplicate-group canonical URL', () => {

wrapper.unmount()
})

it('passes null behaviors when a raw snapshot lacks them', async () => {
const wrapper = await mountSuspended(
await import('../../layers/registry/app/components/SkillDetail.vue').then(module => module.default),
{ props: { owner: 'mirror', repo: 'multi', name: 'shared-skill' } },
)

const panel = wrapper.findComponent(SkillBehaviors)
expect(panel.exists()).toBe(true)
expect(panel.props('behaviors')).toBe(null)
wrapper.unmount()
})
})
Loading