diff --git a/server/app.ts b/server/app.ts index 1d9bfb82..36f33a00 100755 --- a/server/app.ts +++ b/server/app.ts @@ -27,7 +27,7 @@ import reviewRoutes from './routes/review' import searchRoutes from './routes/search' import timetableRoutes from './routes/timetable' import visitRoutes from './routes/visit' -import visitsRoutes from './routes/visits' +import visitsByDateRoutes from './routes/visitsByDate' import type { Services } from './services' import config from './config' import logger from '../logger' @@ -69,7 +69,7 @@ export default function createApp(services: Services): express.Application { app.use('/timetable', timetableRoutes(services)) app.use('/review', reviewRoutes(services)) app.use('/visit', visitRoutes(services)) - app.use('/visits', visitsRoutes(services)) + app.use('/visits', visitsByDateRoutes(services)) app.use((req, res, next) => next(createError(404, 'Not found'))) app.use(errorHandler(process.env.NODE_ENV === 'production')) diff --git a/server/routes/testutils/appSetup.ts b/server/routes/testutils/appSetup.ts index 524fc49f..cdc28225 100644 --- a/server/routes/testutils/appSetup.ts +++ b/server/routes/testutils/appSetup.ts @@ -28,7 +28,7 @@ import reviewRoutes from '../review' import searchRoutes from '../search' import timetableRoutes from '../timetable' import visitRoutes from '../visit' -import visitsRoutes from '../visits' +import visitsRoutes from '../visitsByDate' import nunjucksSetup from '../../utils/nunjucksSetup' import errorHandler from '../../errorHandler' diff --git a/server/routes/visits.test.ts b/server/routes/visitsByDate.test.ts similarity index 100% rename from server/routes/visits.test.ts rename to server/routes/visitsByDate.test.ts diff --git a/server/routes/visits.ts b/server/routes/visitsByDate.ts similarity index 99% rename from server/routes/visits.ts rename to server/routes/visitsByDate.ts index b6fb8d82..f802e9a1 100644 --- a/server/routes/visits.ts +++ b/server/routes/visitsByDate.ts @@ -117,7 +117,7 @@ export default function routes({ operationId: res.locals.appInsightsOperationId, }) - return res.render('pages/visits/summary', { + return res.render('pages/visits/visitsByDate', { errors: req.flash('errors'), formValues: getFlashFormValues(req), dateTabs: getDateTabs(selectedDateString, firstTabDateString, 3), diff --git a/server/views/pages/visits/summary.njk b/server/views/pages/visits/visitsByDate.njk similarity index 100% rename from server/views/pages/visits/summary.njk rename to server/views/pages/visits/visitsByDate.njk diff --git a/server/views/pages/visits/summary.test.ts b/server/views/pages/visits/visitsByDate.test.ts similarity index 98% rename from server/views/pages/visits/summary.test.ts rename to server/views/pages/visits/visitsByDate.test.ts index 0523391b..20fc6ad2 100644 --- a/server/views/pages/visits/summary.test.ts +++ b/server/views/pages/visits/visitsByDate.test.ts @@ -6,9 +6,9 @@ import TestData from '../../../routes/testutils/testData' import { VisitsPageSideNav } from '../../../@types/bapv' import { VisitPreview } from '../../../data/orchestrationApiTypes' -const template = fs.readFileSync('server/views/pages/visits/summary.njk') +const template = fs.readFileSync('server/views/pages/visits/visitsByDate.njk') -describe('Views - Visits summary', () => { +describe('Views - Visits by date', () => { let compiledTemplate: Template let viewContext: Record