Fix TypeScript type errors in frontend test files
- Add missing timezone field to CreateEventResponse mock - Fix createTestRouter signature to accept optional token parameter - Add non-null assertion for dateField element access Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@ vi.mock('@/api/client', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
function createTestRouter() {
|
||||
function createTestRouter(_token?: string) {
|
||||
return createRouter({
|
||||
history: createMemoryHistory(),
|
||||
routes: [
|
||||
@@ -84,7 +84,7 @@ describe('EventDetailView', () => {
|
||||
const wrapper = await mountWithToken()
|
||||
await flushPromises()
|
||||
|
||||
const dateField = wrapper.findAll('.detail__value')[0]
|
||||
const dateField = wrapper.findAll('.detail__value')[0]!
|
||||
expect(dateField.text()).toContain('(Europe/Berlin)')
|
||||
// The formatted date part is locale-dependent but should contain the year
|
||||
expect(dateField.text()).toContain('2026')
|
||||
|
||||
Reference in New Issue
Block a user