2023-03-14 14:18:55 +01:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
2023-08-11 09:12:13 -04:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-14 14:18:55 +01:00
|
|
|
*/
|
|
|
|
|
2018-10-19 16:17:02 +01:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupTest } from 'ember-qunit';
|
|
|
|
import { run } from '@ember/runloop';
|
|
|
|
|
2022-09-15 10:43:17 +02:00
|
|
|
module('Unit | Serializer | policy', function (hooks) {
|
2018-10-19 16:17:02 +01:00
|
|
|
setupTest(hooks);
|
|
|
|
|
|
|
|
// Replace this with your real tests.
|
2022-09-15 10:43:17 +02:00
|
|
|
test('it exists', function (assert) {
|
2018-10-19 16:17:02 +01:00
|
|
|
let store = this.owner.lookup('service:store');
|
|
|
|
let serializer = store.serializerFor('policy');
|
|
|
|
|
|
|
|
assert.ok(serializer);
|
|
|
|
});
|
|
|
|
|
2022-09-15 10:43:17 +02:00
|
|
|
test('it serializes records', function (assert) {
|
2018-10-19 16:17:02 +01:00
|
|
|
let store = this.owner.lookup('service:store');
|
|
|
|
let record = run(() => store.createRecord('policy', {}));
|
|
|
|
|
|
|
|
let serializedRecord = record.serialize();
|
|
|
|
|
|
|
|
assert.ok(serializedRecord);
|
|
|
|
});
|
|
|
|
});
|