46 lines
1.2 KiB
JavaScript
46 lines
1.2 KiB
JavaScript
import { module, test } from 'qunit';
|
|
import { setupTest } from 'ember-qunit';
|
|
|
|
module('Unit | Model | group', function(hooks) {
|
|
setupTest(hooks);
|
|
|
|
let model;
|
|
|
|
hooks.beforeEach(function () {
|
|
let store = this.owner.lookup('service:store');
|
|
model = store.createRecord('group', {});
|
|
});
|
|
|
|
test('it exists', function (assert) {
|
|
assert.ok(model);
|
|
});
|
|
|
|
test('it supports name attr', function (assert) {
|
|
model.set('name', 'Group name');
|
|
assert.equal(model.name, 'Group name');
|
|
});
|
|
|
|
test('it supports description attr', function (assert) {
|
|
model.set('description', 'Group description');
|
|
assert.equal(model.description, 'Group description');
|
|
});
|
|
|
|
test('it supports created time attr', function (assert) {
|
|
const createdTime = new Date();
|
|
model.set('created_time', createdTime);
|
|
assert.equal(model.created_time, createdTime);
|
|
});
|
|
|
|
test('it supports updated time attr', function (assert) {
|
|
const updatedTime = new Date();
|
|
model.set('updated_time', updatedTime);
|
|
assert.equal(model.updated_time, updatedTime);
|
|
});
|
|
|
|
test('it supports disabled attr', function (assert) {
|
|
assert.notOk(model.disabled);
|
|
model.set('disabled', true);
|
|
assert.ok(model.disabled);
|
|
});
|
|
});
|