Skip to content

Commit

Permalink
Merge pull request #1023 from alphagov/add-note-about-testing
Browse files Browse the repository at this point in the history
Document forcing a survey to display for testing
  • Loading branch information
36degrees authored May 4, 2017
2 parents 8ab43d8 + e288969 commit f4e955c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/surveys.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit f4e955c

Please sign in to comment.