Skip to content

Commit

Permalink
Fix level tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Sep 29, 2021
1 parent 2e55751 commit 6fde63c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion api/lib/level.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Level {
*/
async single(email) {
for (const override of (await Override.list(this.pool)).level_override) {
console.error(override);
if (email.match(override.pattern)) {
return await this.user.level(email, override.level);
}
Expand Down
8 changes: 6 additions & 2 deletions api/test/level.srv.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@


const test = require('tape');
const Level = require('../lib/level');
const LevelOverride = require('../lib/level-override');
const Flight = require('./flight');
const nock = require('nock');
const moment = require('moment');
Expand Down Expand Up @@ -86,6 +85,11 @@ flight.user(test, 'hello');
test('Level#user - override', async (t) => {
const level = new Level(flight.config.pool);

await LevelOverride.generate(flight.config.pool, {
pattern: '^[email protected]$',
level: 'sponsor'
});

try {
const usr_pre = await flight.request({
url: 'http://localhost:4999/api/login',
Expand Down

0 comments on commit 6fde63c

Please sign in to comment.