-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support of single app arn (#106)
- Loading branch information
1 parent
bf23955
commit f0abe69
Showing
5 changed files
with
58 additions
and
16 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
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
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,46 @@ | ||
const assert = require('assert'); | ||
const config = require('smart-config'); | ||
const { getPlatformApplicationArn } = require('../src/helpers/aws-utils'); | ||
|
||
describe('get arn', () => { | ||
const app = { appName: 'single', name: 'AppStore' }; | ||
const singeAppName = app.appName + app.name; | ||
|
||
describe('single app arn', () => { | ||
const arn = Date.now().toString(); | ||
|
||
before(() => { | ||
config.set(`push.appsArns.${singeAppName}`, arn); | ||
}); | ||
|
||
it('should return proper arn', () => { | ||
const res = getPlatformApplicationArn(app); | ||
assert.equal(res, arn); | ||
}); | ||
}); | ||
|
||
describe('SaaS Enterprise app arn', () => { | ||
const arn = Date.now().toString(); | ||
|
||
before(() => { | ||
config.set(`push.appsArns.${singeAppName}`, null); | ||
config.set(`push.appsArns.${app.name}`, arn); | ||
}); | ||
|
||
it('should return proper arn', () => { | ||
const res = getPlatformApplicationArn(app); | ||
assert.equal(res, arn); | ||
}); | ||
}); | ||
|
||
describe('Default app arn', () => { | ||
const defaultApp = config.get('push.defaultApp'); | ||
const arn = config.get(`push.appsArns[${defaultApp}]`); | ||
|
||
it('should return proper arn', () => { | ||
const res = getPlatformApplicationArn(); | ||
assert.equal(res, arn); | ||
}); | ||
}); | ||
|
||
}); |