Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/actions/organization/members/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const redisKey = require('../../../utils/key');
const getUserId = require('../../../utils/userData/get-user-id');
const { getMemberData } = require('../../../utils/organization/get-organization-members');
const { checkOrganizationExists } = require('../../../utils/organization');
const isMFAEnabled = require('../../../utils/mfa');
const { isMFAEnabled } = require('../../../utils/mfa');
const {
ORGANIZATIONS_MEMBERS,
USERS_METADATA,
Expand Down Expand Up @@ -37,7 +37,7 @@ async function getMember({ params }) {

const userDataCalls = [getMemberData.call(this, memberKey)];
if (showMfa) {
userDataCalls.push(isMFAEnabled(userId));
userDataCalls.push(isMFAEnabled.call(this, userId));
}

const [member, mfaEnabled] = await Promise.all(userDataCalls);
Expand Down
11 changes: 10 additions & 1 deletion test/suites/actions/organization/members/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ const { createOrganization, createMembers } = require('../../../../helpers/organ
describe('#get organization member', function registerSuite() {
this.timeout(50000);

beforeEach(startService);
beforeEach(async function () {
await startService.call(this, {
organizations: {
audience: 'organizations',
showMfa: true,
},
});
});
beforeEach(function pretest() { return createMembers.call(this); });
beforeEach(function pretest() { return createOrganization.call(this); });
afterEach(clearRedis);
Expand All @@ -30,6 +37,8 @@ describe('#get organization member', function registerSuite() {
.then((response) => {
assert(response.data.hasOwnProperty('id'));
assert(response.data.hasOwnProperty('type'));
assert(response.data.hasOwnProperty('attributes'));
assert(response.data.attributes.hasOwnProperty('mfaEnabled'));
assert.deepEqual(response.data.attributes.username, opts.username);
});
});
Expand Down