Repository URL to install this package:
|
Version:
7.13.0-rc.4 ▾
|
import { isOrgAdmin } from './user';
describe('user.isOrgAdmin', () => {
it('should return true if user.data.premium.active.organisationAdmin is set', () => {
expect(
isOrgAdmin({
data: { premium: { active: { organisationAdmin: true } } },
})
).toEqual(true);
});
it('should return false if user.data.premium.active.organisationAdmin is not set', () => {
expect(
isOrgAdmin({
data: { premium: { active: undefined } },
})
).toEqual(false);
});
it('should return false if user is not set', () => {
expect(isOrgAdmin(undefined)).toEqual(false);
});
it('should return true if isAdmin is set', () => {
expect(
isOrgAdmin({
isAdmin: true,
data: { premium: { active: undefined } },
})
).toEqual(true);
});
it('should return false if isAdmin is not set', () => {
expect(
isOrgAdmin({
isAdmin: undefined,
data: { premium: { active: undefined } },
})
).toEqual(false);
});
});