Merge comments

This commit is contained in:
Nora
2022-11-15 14:19:35 +01:00
parent cf7e33363a
commit a012d80341
2 changed files with 17 additions and 14 deletions

View File

@@ -11,11 +11,11 @@ export interface DbConfigDatabases {
} }
export interface SelectedDbItem { export interface SelectedDbItem {
kind: SelectedDbKind; kind: SelectedDbItemKind;
value: string; value: string;
} }
export enum SelectedDbKind { export enum SelectedDbItemKind {
ConfigDefined = 'configDefined', ConfigDefined = 'configDefined',
RemoteSystemDefinedList = 'remoteSystemDefinedList', RemoteSystemDefinedList = 'remoteSystemDefinedList',
} }

View File

@@ -11,23 +11,26 @@ describe('db config validation', async () => {
// We're intentionally bypassing the type check because we'd // We're intentionally bypassing the type check because we'd
// like to make sure validation errors are highlighted. // like to make sure validation errors are highlighted.
const dbConfig = { const dbConfig = {
'remote': { 'databases': {
'repositoryLists': [ 'remote': {
{ 'repositoryLists': [
'name': 'repoList1', {
'repositories': ['foo/bar', 'foo/baz'] 'name': 'repoList1',
} 'repositories': ['foo/bar', 'foo/baz']
], }
'repositories': ['owner/repo1', 'owner/repo2', 'owner/repo3'], ],
'somethingElse': 'bar' 'repositories': ['owner/repo1', 'owner/repo2', 'owner/repo3'],
'somethingElse': 'bar'
}
} }
} as any as DbConfig; } as any as DbConfig;
const validationOutput = configValidator.validate(dbConfig); const validationOutput = configValidator.validate(dbConfig);
expect(validationOutput).to.have.length(2); expect(validationOutput).to.have.length(3);
expect(validationOutput[0]).to.deep.equal(' must have required property \'databases\''); expect(validationOutput[0]).to.deep.equal('/databases must have required property \'local\'');
expect(validationOutput[1]).to.deep.equal(' must NOT have additional properties'); expect(validationOutput[1]).to.deep.equal('/databases/remote must have required property \'owners\'');
expect(validationOutput[2]).to.deep.equal('/databases/remote must NOT have additional properties');
}); });
}); });