-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from paulcwatts/fix-build
Fix lint errors
- Loading branch information
Showing
7 changed files
with
38 additions
and
45 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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { get } from '@ember/object'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
import { CognitoUserAttribute } from 'amazon-cognito-identity-js'; | ||
|
@@ -12,9 +11,9 @@ module('Unit | Service | cognito', function(hooks) { | |
|
||
test('config is set correctly', function(assert) { | ||
const service = this.owner.lookup('service:cognito'); | ||
assert.equal(get(service, 'poolId'), 'us-east-1_TEST'); | ||
assert.equal(get(service, 'clientId'), 'TEST'); | ||
assert.equal(get(service, 'authenticationFlowType'), config.cognito.authenticationFlowType); | ||
assert.equal(service.poolId, 'us-east-1_TEST'); | ||
assert.equal(service.clientId, 'TEST'); | ||
assert.equal(service.authenticationFlowType, config.cognito.authenticationFlowType); | ||
}); | ||
|
||
test('signup works', async function(assert) { | ||
|
@@ -76,11 +75,11 @@ module('Unit | Service | cognito', function(hooks) { | |
const validation = [{ 'foo': 'bar' }]; | ||
|
||
await service.signUp('testuser', 'password', attrs, validation); | ||
assert.deepEqual(get(auth, 'attributes'), { | ||
assert.deepEqual(auth.attributes, { | ||
email: '[email protected]', | ||
phone_number: '555-1212' | ||
}); | ||
assert.deepEqual(get(auth, 'validationData'), [{ 'foo': 'bar' }]); | ||
assert.deepEqual(auth.validationData, [{ 'foo': 'bar' }]); | ||
}); | ||
|
||
test('getIdToken auth', async function(assert) { | ||
|
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
import { get } from '@ember/object'; | ||
import { mockAuth, MockAuth, mockCognitoUser, newUser, unmockCognitoUser } from 'ember-cognito/test-support'; | ||
|
||
module('Unit | Utility | mock helpers', function(hooks) { | ||
|
@@ -15,14 +14,14 @@ module('Unit | Utility | mock helpers', function(hooks) { | |
] | ||
}); | ||
let cognito = this.owner.lookup('service:cognito'); | ||
assert.deepEqual(get(cognito, 'user.userAttributes'), [ | ||
assert.deepEqual(cognito.user.userAttributes, [ | ||
{ name: 'sub', value: 'aaaabbbb-cccc-dddd-eeee-ffffgggghhhh' }, | ||
{ name: 'email', value: '[email protected]' } | ||
]); | ||
|
||
await unmockCognitoUser(); | ||
assert.notOk(get(cognito, 'user')); | ||
assert.equal(get(cognito, 'auth._authenticatedUser.username'), 'testuser'); | ||
assert.notOk(cognito.user); | ||
assert.equal(cognito.auth._authenticatedUser.username, 'testuser'); | ||
}); | ||
|
||
test('newUser', async function(assert) { | ||
|
@@ -33,12 +32,12 @@ module('Unit | Utility | mock helpers', function(hooks) { | |
test('mockAuth can accept an auth class', async function(assert) { | ||
await mockAuth(MockAuth.extend({ foo: 'bar' })); | ||
const cognito = this.owner.lookup('service:cognito'); | ||
assert.equal(get(cognito, 'auth.foo'), 'bar'); | ||
assert.equal(cognito.auth.foo, 'bar'); | ||
}); | ||
|
||
test('mockAuth can accept an auth instance', async function(assert) { | ||
await mockAuth(MockAuth.create({ bar: 'baz' })); | ||
const cognito = this.owner.lookup('service:cognito'); | ||
assert.equal(get(cognito, 'auth.bar'), 'baz'); | ||
assert.equal(cognito.auth.bar, 'baz'); | ||
}); | ||
}); |
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