fix the tests
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { afterAll, beforeEach, describe, expect, it } from 'vitest'
|
||||
import { serializeReservationForDashboard } from './reservation.presenter'
|
||||
|
||||
describe('serializeReservationForDashboard', () => {
|
||||
const originalDashboardUrl = process.env.DASHBOARD_URL
|
||||
const originalPublicDashboardUrl = process.env.NEXT_PUBLIC_DASHBOARD_URL
|
||||
|
||||
beforeEach(() => {
|
||||
process.env.DASHBOARD_URL = 'http://localhost:3000/dashboard'
|
||||
process.env.NEXT_PUBLIC_DASHBOARD_URL = ''
|
||||
})
|
||||
|
||||
afterAll(() => {
|
||||
process.env.DASHBOARD_URL = originalDashboardUrl
|
||||
process.env.NEXT_PUBLIC_DASHBOARD_URL = originalPublicDashboardUrl
|
||||
})
|
||||
|
||||
it('rewrites customer license image URLs to the protected route', () => {
|
||||
const result = serializeReservationForDashboard({
|
||||
id: 'reservation-1',
|
||||
|
||||
Reference in New Issue
Block a user