-
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
886bf48
commit d5bf175
Showing
4 changed files
with
39 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const queries = require('./calendar.queries.js'); | ||
|
||
module.exports = function getFirstEventTodayUser(userId) { | ||
return gladys.utils.sqlUnique(queries.getFirstEventTodayUser, [userId]); | ||
}; |
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
22 changes: 22 additions & 0 deletions
22
test/unit/api/core/calendar/calendar.getFirstEventTodayUser.test.js
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,22 @@ | ||
var should = require('should'); | ||
var validateCalendarEvent = require('../../validator/calendarEventValidator.js'); | ||
|
||
describe('Calendar', function() { | ||
|
||
describe('getFirstEventTodayUser', function() { | ||
|
||
it('should return first event today user', function (done) { | ||
|
||
gladys.calendar.getFirstEventTodayUser(1) | ||
.then(function(events){ | ||
done(); | ||
}).catch(function(err){ | ||
if(err.message == 'NotFound') done(); | ||
else done(err); | ||
}); | ||
|
||
}); | ||
|
||
}); | ||
|
||
}); |