* refactor: 💡 initial changes for updating breadcrumbs to use hds * refactor: 💡 add breadcrumbs to all paths * refactor: 💡 add more hds breadcrumbs to remaining paths * refactor: 💡 remove BreadCrumbs from templates * refactor: 💡 remove breadcrumb only controller files * test: 💍 remove unnused test files & add missing tests * test: 💍 update tests * test: 💍 add missing scope in test * test: 💍 fix test * refactor: 💡 remove icons * refactor: 💡 remove addon and use service instead * docs: ✏️ add comment to breadcrumb service * test: 💍 update service unit test * docs: ✏️ add comments to breadcrumb components * Update ui/admin/app/components/breadcrumbs/container/index.js Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com> --------- Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
34 lines
1.0 KiB
JavaScript
34 lines
1.0 KiB
JavaScript
import { module, test } from 'qunit';
|
|
import { setupTest } from 'admin/tests/helpers';
|
|
|
|
module('Unit | Service | breadcrumbs', function (hooks) {
|
|
setupTest(hooks);
|
|
|
|
test('it exists', function (assert) {
|
|
assert.expect(1);
|
|
const service = this.owner.lookup('service:breadcrumbs');
|
|
assert.ok(service);
|
|
});
|
|
|
|
test('registerContainer properly adds a new container', function (assert) {
|
|
assert.expect(1);
|
|
const container = { element: 'element' };
|
|
const service = this.owner.lookup('service:breadcrumbs');
|
|
|
|
service.registerContainer(container);
|
|
|
|
assert.strictEqual(service.containers[0].element, container.element);
|
|
});
|
|
|
|
test('unregisterContainer properly removes an existing container', function (assert) {
|
|
assert.expect(1);
|
|
const container = { element: 'element' };
|
|
const service = this.owner.lookup('service:breadcrumbs');
|
|
|
|
service.registerContainer(container);
|
|
service.unregisterContainer(container);
|
|
|
|
assert.strictEqual(service.containers.length, 0);
|
|
});
|
|
});
|