Skip to content

Commit

Permalink
Merge pull request #27 from coveo/fix-no-securityCache-in-platformres…
Browse files Browse the repository at this point in the history
…source.ts

fix(platformressources.ts): export the SecurityCache calls
  • Loading branch information
dmgauthier authored Oct 23, 2019
2 parents d8a40cb + 3ce9f4b commit 1068bba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/resources/PlatformResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class PlatformResources {
group: Group;
organization: Organization;
apiKey: ApiKey;
securityCache: SecurityCache;

registerAll() {
resourcesMap.forEach(({key, resource}) => {
Expand Down
18 changes: 18 additions & 0 deletions src/resources/tests/PlatformResources.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import ApiKey from '../ApiKeys/ApiKeys';
import AWS from '../AWS/AWS';
import Catalog from '../Catalogs/Catalog';
import Cluster from '../Clusters/Cluster';
import Group from '../Groups/Groups';
import Organization from '../Organizations/Organization';
import PlatformResources from '../PlatformResources';
import SecurityCache from '../SecurityCache/SecurityCache';

describe('PlatformResources', () => {
describe('registerAll', () => {
Expand Down Expand Up @@ -46,5 +48,21 @@ describe('PlatformResources', () => {
expect(platformResources.organization).toBeDefined();
expect(platformResources.organization).toBeInstanceOf(Organization);
});

it('should register the securityCache resource on the platform instance', () => {
const platformResources = new PlatformResources();
platformResources.registerAll();

expect(platformResources.securityCache).toBeDefined();
expect(platformResources.securityCache).toBeInstanceOf(SecurityCache);
});

it('should register the api keys ressource on the platform instance', () => {
const platformResources = new PlatformResources();
platformResources.registerAll();

expect(platformResources.apiKey).toBeDefined();
expect(platformResources.apiKey).toBeInstanceOf(ApiKey);
});
});
});

0 comments on commit 1068bba

Please sign in to comment.