2020-09-14 10:45:56 -04:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
|
import { setupTest } from 'ember-qunit';
|
|
|
|
|
|
2020-09-16 14:29:02 -04:00
|
|
|
module('Unit | Model | account', function (hooks) {
|
2020-09-14 10:45:56 -04:00
|
|
|
setupTest(hooks);
|
|
|
|
|
|
2020-09-16 14:29:02 -04:00
|
|
|
test('it exists', function (assert) {
|
2020-09-14 10:45:56 -04:00
|
|
|
let store = this.owner.lookup('service:store');
|
|
|
|
|
let model = store.createRecord('account', {});
|
|
|
|
|
assert.ok(model);
|
|
|
|
|
});
|
2020-09-17 14:39:15 -04:00
|
|
|
|
2020-09-18 14:15:19 -04:00
|
|
|
test('it has an username attribute for password account', function (assert) {
|
2020-09-17 14:39:15 -04:00
|
|
|
assert.expect(2);
|
|
|
|
|
const store = this.owner.lookup('service:store');
|
|
|
|
|
let model = store.createRecord('account', {
|
|
|
|
|
name: 'name',
|
|
|
|
|
type: 'password',
|
|
|
|
|
});
|
2020-09-18 14:33:10 -04:00
|
|
|
assert.notOk(model.username);
|
2020-09-17 14:39:15 -04:00
|
|
|
model.attributes.login_name = 'username';
|
|
|
|
|
assert.equal(model.username, 'username');
|
|
|
|
|
});
|
2020-09-18 14:15:19 -04:00
|
|
|
|
2020-09-14 10:45:56 -04:00
|
|
|
});
|