Files

24 lines
756 B
JavaScript

import { module, test } from 'qunit';
import { setupTest } from 'dashtab/tests/helpers';
module('Unit | Service | storage', function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let service = this.owner.lookup('service:storage');
assert.ok(service);
});
test('it round-trips the icons namespace', async function (assert) {
const service = this.owner.lookup('service:storage');
const key = 'https://forum.example.com';
const record = { href: 'https://forum.example.com/icon.png' };
await service.set('icons', key, record);
assert.deepEqual(await service.get('icons', key), record);
await service.remove('icons', key);
assert.strictEqual(await service.get('icons', key), null);
});
});