Skip to content

Commit

Permalink
chore: broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Dec 24, 2024
1 parent eedc63e commit e05b0c7
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/fixtures/basic/__runtime__/breadcrumbs.nuxt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ describe('useBreadcrumbItems', () => {
`)
})
it('subpath', async () => {
useI18nMock.mockImplementation(() => {
return {
t: vi.fn().mockImplementation((s: string, fallback: string) => {
return fallback
})
}
})
// change the path
useRouterMock.mockImplementation(() => {
return {
Expand Down Expand Up @@ -94,6 +101,16 @@ describe('useBreadcrumbItems', () => {
`)
})
it('i18n', async () => {
useI18nMock.mockImplementation(() => {
return {
t: vi.fn().mockImplementation((s: string, fallback: string) => {
if (s === 'breadcrumb.items.about.label') {
return 'About I18n'
}
return fallback
}),
}
})
useRouterMock.mockImplementation(() => {
return {
currentRoute: {
Expand Down Expand Up @@ -136,6 +153,13 @@ describe('useBreadcrumbItems', () => {
`)
})
it('catch-all', async () => {
useI18nMock.mockImplementation(() => {
return {
t: vi.fn().mockImplementation((s: string, fallback: string) => {
return fallback
})
}
})
// change the path
useRouterMock.mockImplementation(() => {
return {
Expand Down Expand Up @@ -197,6 +221,13 @@ describe('useBreadcrumbItems', () => {
})

it('catch-all #2', async () => {
useI18nMock.mockImplementation(() => {
return {
t: vi.fn().mockImplementation((s: string, fallback: string) => {
return fallback
})
}
})
// change the path
useRouterMock.mockImplementation(() => {
return {
Expand Down

0 comments on commit e05b0c7

Please sign in to comment.