Correctly announce loading state for arc cluster context loading (#15747)

* Correctly announce loading state for arc cluster context loading

* localize

* Fix compile

* Fix test
This commit is contained in:
Charles Gagnon
2021-06-17 10:28:12 -07:00
committed by GitHub
parent 7c3a7e2646
commit cae598d36c
6 changed files with 32 additions and 12 deletions

View File

@@ -18,7 +18,7 @@ const newFileUri = vscode.Uri.file(path.join('path', 'to', 'new', '.kube', 'conf
describe('filePicker', function (): void {
beforeEach(async () => {
const { modelBuilderMock } = createModelViewMock();
filePicker = new FilePicker(modelBuilderMock.object, initialPath, (_disposable) => { }, '');
filePicker = new FilePicker(modelBuilderMock.object, initialPath, (_disposable) => { }, '', '');
});
afterEach(() => {

View File

@@ -5,10 +5,10 @@
import * as azdata from 'azdata';
import * as should from 'should';
import { getErrorMessage } from '../../../common/utils';
import { RadioOptionsGroup, RadioOptionsInfo } from '../../../ui/components/radioOptionsGroup';
import { createModelViewMock } from '@microsoft/azdata-test/out/mocks/modelView/modelViewMock';
import { StubRadioButton } from '@microsoft/azdata-test/out/stubs/modelView/stubRadioButton';
import * as loc from '../../../localizedConstants';
const loadingError = new Error('Error loading options');
@@ -25,7 +25,7 @@ let radioOptionsGroup: RadioOptionsGroup;
describe('radioOptionsGroup', function (): void {
beforeEach(async () => {
const { modelBuilderMock } = createModelViewMock();
radioOptionsGroup = new RadioOptionsGroup(modelBuilderMock.object, (_disposable) => { });
radioOptionsGroup = new RadioOptionsGroup(modelBuilderMock.object, (_disposable) => { }, undefined, '', () => '');
await radioOptionsGroup.load(async () => radioOptionsInfo);
});
@@ -51,7 +51,7 @@ describe('radioOptionsGroup', function (): void {
radioOptionsGroup.items.length.should.equal(1, 'There is should be only one element in the divContainer when loading error happens');
const label = radioOptionsGroup.items[0] as azdata.TextComponent;
should(label.value).not.be.undefined();
label.value!.should.deepEqual(getErrorMessage(loadingError));
label.value!.should.deepEqual(loc.loadingClusterContextsError(loadingError));
should(label.CSSStyles).not.be.undefined();
should(label.CSSStyles!.color).not.be.undefined();
label.CSSStyles!.color.should.equal('Red');