-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from Turistforeningen/feat/list-log
Implement /lister/{id}/logg API endpoint
- Loading branch information
Showing
10 changed files
with
147 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */ | ||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
const mockery = require('mockery'); | ||
|
||
describe('Checkin', () => { | ||
before(() => mockery.enable({ | ||
useCleanCache: true, | ||
warnOnReplace: false, | ||
warnOnUnregistered: false, | ||
})); | ||
|
||
afterEach(() => mockery.deregisterMock('node-fetch')); | ||
|
||
after(() => mockery.disable()); | ||
|
||
describe('#getCheckinsForList()', () => { | ||
it('it returns existing checkins for existing list', () => { | ||
// Mock node-fetch | ||
mockery.registerMock('node-fetch', () => Promise.resolve({ | ||
status: 200, | ||
json: () => ({ | ||
steder: ['400000000000000000000000', '400000000000000000000001'], | ||
}), | ||
})); | ||
|
||
// Require Checkin (it now uses the mock above) | ||
const Checkin = require('../../models/Checkin'); // eslint-disable-line global-require | ||
|
||
return Checkin.getCheckinsForList('300000000000000000000000') | ||
.then(checkins => { | ||
assert.equal(checkins.length, 3); | ||
}); | ||
}); | ||
}); | ||
}); |
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