From e2889699b0ca45a4a29d223326acca1f25ab18b7 Mon Sep 17 00:00:00 2001 From: Oliver Byford Date: Thu, 4 May 2017 10:43:48 +0100 Subject: [PATCH] Document forcing a survey to display for testing Bonus: Also fix a incorrectly formatted heading. --- doc/surveys.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/surveys.md b/doc/surveys.md index 3a61cbe7c..28151d110 100644 --- a/doc/surveys.md +++ b/doc/surveys.md @@ -120,5 +120,8 @@ function organisationMatches() { Not providing the `activeWhen` argument has the same effect as setting it to `return true`. The survey will therefore apply to all pages on GOV.UK between `startTime` and `endTime`. -### `startTime` and `endTime` +### `startTime` and `endTime` The survey will only be considered "active" between these dates and times. Where an explicit time is not provided (e.g. startTime) note that JavaScript will assume 00:00:00.000 i.e. just after midnight. + +## Testing Surveys +If you need to force a particular survey to display – for example for testing – you can call e.g. `GOVUK.userSurveys.displaySurvey(GOVUK.userSurveys.defaultSurvey)` or `GOVUK.userSurveys.displaySurvey(GOVUK.userSurveys.smallSurveys[0])` from your browser console.