mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 21:27:52 +00:00
Upgrade to karma-jasmine
5.1.0 and fix unit tests (#5503)
This commit is contained in:
parent
0062191416
commit
0e1cc5dc30
@ -58,7 +58,6 @@ test.describe('Restricted Notebook', () => {
|
||||
page.locator('text=OK').click(),
|
||||
page.waitForSelector('.c-message-banner__message')
|
||||
]);
|
||||
await page.locator('.c-message-banner__close-button').click();
|
||||
|
||||
// has been deleted
|
||||
expect(await restrictedNotebookTreeObject.count()).toEqual(0);
|
||||
|
@ -42,7 +42,7 @@
|
||||
"karma-coverage": "2.2.0",
|
||||
"karma-coverage-istanbul-reporter": "3.0.3",
|
||||
"karma-firefox-launcher": "2.1.2",
|
||||
"karma-jasmine": "4.0.1",
|
||||
"karma-jasmine": "5.1.0",
|
||||
"karma-junit-reporter": "2.0.1",
|
||||
"karma-sourcemap-loader": "0.3.8",
|
||||
"karma-spec-reporter": "0.0.34",
|
||||
|
@ -155,7 +155,7 @@ describe("The LAD Table", () => {
|
||||
// add another telemetry object as composition in lad table to test multi rows
|
||||
mockObj.ladTable.composition.push(anotherTelemetryObj.identifier);
|
||||
|
||||
beforeEach(async (done) => {
|
||||
beforeEach(async () => {
|
||||
let telemetryRequestResolve;
|
||||
let telemetryObjectResolve;
|
||||
let anotherTelemetryObjectResolve;
|
||||
@ -204,8 +204,6 @@ describe("The LAD Table", () => {
|
||||
|
||||
await Promise.all([telemetryRequestPromise, telemetryObjectPromise, anotherTelemetryObjectPromise]);
|
||||
await Vue.nextTick();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it("should show one row per object in the composition", () => {
|
||||
|
@ -49,6 +49,7 @@ describe("the plugin", () => {
|
||||
let parentObject;
|
||||
let parentObjectPath;
|
||||
let changedParentObject;
|
||||
let unobserve;
|
||||
beforeEach((done) => {
|
||||
parentObject = {
|
||||
name: 'mock folder',
|
||||
@ -73,7 +74,7 @@ describe("the plugin", () => {
|
||||
});
|
||||
});
|
||||
|
||||
openmct.objects.observe(parentObject, '*', (newObject) => {
|
||||
unobserve = openmct.objects.observe(parentObject, '*', (newObject) => {
|
||||
changedParentObject = newObject;
|
||||
|
||||
done();
|
||||
@ -81,6 +82,9 @@ describe("the plugin", () => {
|
||||
|
||||
newFolderAction.invoke(parentObjectPath);
|
||||
});
|
||||
afterEach(() => {
|
||||
unobserve();
|
||||
});
|
||||
|
||||
it('creates a new folder object', () => {
|
||||
expect(openmct.objects.save).toHaveBeenCalled();
|
||||
|
@ -71,7 +71,7 @@ describe("the RemoteClock plugin", () => {
|
||||
parse: (datum) => datum.key
|
||||
};
|
||||
|
||||
beforeEach((done) => {
|
||||
beforeEach(async () => {
|
||||
openmct.install(openmct.plugins.RemoteClock(TIME_TELEMETRY_ID));
|
||||
|
||||
let clocks = openmct.time.getAllClocks();
|
||||
@ -113,9 +113,7 @@ describe("the RemoteClock plugin", () => {
|
||||
end: OFFSET_END
|
||||
});
|
||||
|
||||
Promise.all([objectPromiseResolve, requestPromise])
|
||||
.then(done)
|
||||
.catch(done);
|
||||
await Promise.all([objectPromiseResolve, requestPromise]);
|
||||
});
|
||||
|
||||
it('is available and sets up initial values and listeners', () => {
|
||||
|
@ -78,13 +78,15 @@ describe("the plugin", () => {
|
||||
|
||||
describe('when invoked', () => {
|
||||
|
||||
beforeEach((done) => {
|
||||
beforeEach(() => {
|
||||
openmct.overlays.overlay = function (options) {};
|
||||
|
||||
spyOn(openmct.overlays, 'overlay');
|
||||
|
||||
viewDatumAction.invoke(mockObjectPath, mockView);
|
||||
});
|
||||
|
||||
it('creates an overlay', () => {
|
||||
expect(openmct.overlays.overlay).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user