Skip to content

Commit

Permalink
fix jasmine tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clemiller committed Apr 30, 2024
1 parent 572d16d commit cd58d9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
15 changes: 1 addition & 14 deletions nav-app/src/app/tabs/tabs.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,23 +474,10 @@ describe('TabsComponent', () => {
component.openUploadPrompt();
expect(logSpy).toHaveBeenCalled();
let blob = new Blob([JSON.stringify(MockLayers.layerFile2)], { type: 'text/json' });
let file = new File([blob], 'layer-2.json');
let file = new File([blob], 'layer-1.json');
component.readJSONFile(file).then(() => {
expect(component.layerTabs.length).toEqual(1);
});
let layer = MockLayers.layerFile2;
layer.viewMode = 2;
blob = new Blob([JSON.stringify(layer)], { type: 'text/json' });
file = new File([blob], 'layer-2.json');
component.readJSONFile(file).then(() => {
expect(component.layerTabs.length).toEqual(2);
});
layer.viewMode = 0;
blob = new Blob([JSON.stringify(layer)], { type: 'text/json' });
file = new File([blob], 'layer-2.json');
component.readJSONFile(file).then(() => {
expect(component.layerTabs.length).toEqual(3);
});
}));

it('should retrieve the minimum supported version', () => {
Expand Down
4 changes: 2 additions & 2 deletions nav-app/src/app/tabs/tabs.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ export class TabsComponent implements AfterViewInit {
} catch (err) {
console.error(err);
alert(`ERROR parsing layer, check the javascript console for more information.`);
this.viewModelsService.destroyViewModel(viewModel);
self.viewModelsService.destroyViewModel(viewModel);
resolve(null); // continue
}
}
Expand Down Expand Up @@ -844,7 +844,7 @@ export class TabsComponent implements AfterViewInit {
} catch (err) {
console.error(err);
alert(`ERROR parsing layer from ${loadURL}, check the javascript console for more information.`);
this.viewModelsService.destroyViewModel(viewModel);
self.viewModelsService.destroyViewModel(viewModel);
resolve(null); // continue
}
};
Expand Down

0 comments on commit cd58d9b

Please sign in to comment.