Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
[#869] Fix 'changes' test
Browse files Browse the repository at this point in the history
Mocks the date to 2016 to ensure test consistency with fixtures.
  • Loading branch information
brew committed Jan 4, 2017
1 parent 25b99e3 commit 44a25ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"react-addons-test-utils": "^15.3.0",
"rewire": "^2.5.2",
"supertest": "^2.0.0",
"timekeeper": "^1.0.0",
"zombie": "^4.1.0"
},
"engines": {
Expand Down
15 changes: 13 additions & 2 deletions tests/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@ var _ = require('lodash');
var assert = require('chai').assert;
var testUtils = require('./utils');
var marked = require('marked');
var tk = require('timekeeper');

var entryFixtures = require('../fixtures/entry');
var datasetFixtures = require('../fixtures/dataset');
var userFixtures = require('../fixtures/user');
var questionSetFixtures = require('../fixtures/questionset');

describe('Basics', function() {
before(function() {
// Mock date to 2016 for consistent testing
tk.freeze(new Date(2016, 11, 30));
});

after(function() {
// Reset date mock
tk.reset();
});

before(testUtils.startApplication);
after(testUtils.shutdownApplication);

Expand Down Expand Up @@ -95,8 +106,8 @@ describe('Basics', function() {
this.browser.visit('/', () => {
assert.ok(this.browser.success);
var html = this.browser.html();
_.forEach(['custom_css', 'navbar_logo',
'custom_footer', 'support_url'],
_.forEach(
['custom_css', 'navbar_logo', 'custom_footer', 'support_url'],
settingName => {
var textToCheck = site.settings[settingName];
assert.include(html, textToCheck);
Expand Down

0 comments on commit 44a25ad

Please sign in to comment.