Commit 7c5d4942 authored by Mike Greiling's avatar Mike Greiling

fix frontend tests

parent c454dec1
/* global CommitsList */ /* global CommitsList */
//= require jquery.endless-scroll require('vendor/jquery.endless-scroll');
//= require pager require('~/pager');
//= require commits require('~/commits');
(() => { (() => {
// TODO: remove this hack!
// PhantomJS causes spyOn to panic because replaceState isn't "writable"
let phantomjs;
try {
phantomjs = !Object.getOwnPropertyDescriptor(window.history, 'replaceState').writable;
} catch (err) {
phantomjs = false;
}
describe('Commits List', () => { describe('Commits List', () => {
beforeEach(() => { beforeEach(() => {
setFixtures(` setFixtures(`
...@@ -25,7 +34,10 @@ ...@@ -25,7 +34,10 @@
beforeEach(() => { beforeEach(() => {
CommitsList.init(25); CommitsList.init(25);
CommitsList.searchField.val(''); CommitsList.searchField.val('');
if (!phantomjs) {
spyOn(history, 'replaceState').and.stub(); spyOn(history, 'replaceState').and.stub();
}
ajaxSpy = spyOn(jQuery, 'ajax').and.callFake((req) => { ajaxSpy = spyOn(jQuery, 'ajax').and.callFake((req) => {
req.success({ req.success({
data: '<li>Result</li>', data: '<li>Result</li>',
......
/* global Turbolinks */ /* global Turbolinks */
//= require turbolinks require('~/lib/utils/common_utils');
//= require lib/utils/common_utils require('~/filtered_search/filtered_search_token_keys');
//= require filtered_search/filtered_search_token_keys require('~/filtered_search/filtered_search_tokenizer');
//= require filtered_search/filtered_search_tokenizer require('~/filtered_search/filtered_search_dropdown_manager');
//= require filtered_search/filtered_search_dropdown_manager require('~/filtered_search/filtered_search_manager');
//= require filtered_search/filtered_search_manager
(() => { (() => {
describe('Filtered Search Manager', () => { describe('Filtered Search Manager', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment