This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { mount } from 'enzyme'; | |
import apiService from 'src/services/api-service'; | |
apiService.fetch = jest.fn(() => Promise.resolve([{ name: 'foo' }])); | |
import Container from './Container'; | |
import Form from '../form/Form'; | |
import Results from '../results/Results'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Checkin Repository', () => { | |
let checkinRepository, httpBackend; | |
beforeEach(() => { | |
module('app'); | |
}); | |
beforeEach(inject(($httpBackend, checkinDeviceRepository) => { | |
httpBackend = $httpBackend; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// By the way — no idea why the function definition contains 'result' as a second argument; | |
// this is not present in the Underscore library. | |
_.flatten = function(nestedArray, result) { | |
var resultingArray = []; | |
_.each(nestedArray, function(element, index, nestedArray){ | |
flattenHelper(element, resultingArray); | |
}); | |
return resultingArray; | |
}; |