mirror of
https://github.com/nasa/openmct.git
synced 2025-05-03 17:22:56 +00:00
Add test for identifier generation
This commit is contained in:
parent
5ec3b98d1c
commit
3f1b7e0a87
@ -14,7 +14,8 @@ define(['../src/SummaryWidget', 'zepto'], function (SummaryWidget, $) {
|
|||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockDomainObject = {
|
mockDomainObject = {
|
||||||
identifier: {
|
identifier: {
|
||||||
key: 'testKey'
|
key: 'testKey',
|
||||||
|
namespace: 'testNamespace'
|
||||||
},
|
},
|
||||||
name: 'testName',
|
name: 'testName',
|
||||||
composition: [],
|
composition: [],
|
||||||
@ -49,7 +50,7 @@ define(['../src/SummaryWidget', 'zepto'], function (SummaryWidget, $) {
|
|||||||
mockObjectService.getObjects = jasmine.createSpy('objectService');
|
mockObjectService.getObjects = jasmine.createSpy('objectService');
|
||||||
mockObjectService.getObjects.andReturn(new Promise(function (resolve, reject) {
|
mockObjectService.getObjects.andReturn(new Promise(function (resolve, reject) {
|
||||||
resolve({
|
resolve({
|
||||||
testKey: mockOldDomainObject
|
'testNamespace:testKey': mockOldDomainObject
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
mockOpenMCT = jasmine.createSpyObj('openmct', [
|
mockOpenMCT = jasmine.createSpyObj('openmct', [
|
||||||
@ -73,6 +74,10 @@ define(['../src/SummaryWidget', 'zepto'], function (SummaryWidget, $) {
|
|||||||
summaryWidget.show(mockContainer);
|
summaryWidget.show(mockContainer);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('queries with legacyId', function () {
|
||||||
|
expect(mockObjectService.getObjects).toHaveBeenCalledWith(['testNamespace:testKey']);
|
||||||
|
});
|
||||||
|
|
||||||
it('adds its DOM element to the view', function () {
|
it('adds its DOM element to the view', function () {
|
||||||
expect(mockContainer.getElementsByClassName('w-summary-widget').length).toBeGreaterThan(0);
|
expect(mockContainer.getElementsByClassName('w-summary-widget').length).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user