-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Read Operator resource data * Update CDN URL * 5.10.1
- Loading branch information
Showing
6 changed files
with
29 additions
and
6 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -9,16 +9,30 @@ module.exports = () => { | |
operator = getScope('operator') | ||
}) | ||
|
||
it('should read Operator resource', async () => { | ||
expect(operator.id).to.equal('operatorId') | ||
expect(operator.email).to.equal('[email protected]') | ||
expect(operator.firstName).to.equal('Test') | ||
expect(operator.lastName).to.equal('User') | ||
}) | ||
|
||
it('should allow self-same Operator update', async () => { | ||
mockApi().put('/operators/operatorId') | ||
.reply(200, {}) | ||
.reply(200, { | ||
customFields: { foo: 'bar' } | ||
}) | ||
const res = await operator.update({ | ||
customFields: { | ||
foo: 'bar' | ||
} | ||
}) | ||
|
||
// Response should be accurate of new state | ||
expect(res).to.be.an('object') | ||
expect(res.customFields.foo).to.equal('bar') | ||
|
||
// Operator should have updated state | ||
expect(operator.customFields.foo).to.equal('bar') | ||
}) | ||
}) | ||
} |
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 |
---|---|---|
|
@@ -20,6 +20,14 @@ const mockApi = (apiUrl = API_URL) => nock(apiUrl) | |
*/ | ||
const setup = async () => { | ||
mockApi().get('/access').reply(200, { actor: { id: 'operatorId' } }) | ||
mockApi().get('/operators/operatorId').reply(200, { | ||
id: 'operatorId', | ||
createdAt: 1471862430968, | ||
updatedAt: 1607002260749, | ||
email: '[email protected]', | ||
firstName: 'Test', | ||
lastName: 'User', | ||
}) | ||
const operator = new Operator(OPERATOR_API_KEY) | ||
await operator.init() | ||
|
||
|