Fix sample container is not populated with items (#459)

This commit is contained in:
victor-meng 2021-03-02 10:41:50 -08:00 committed by GitHub
parent 56b5a9861b
commit 4127d0f522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,7 @@ describe("ContainerSampleGenerator", () => {
const database = {
id: ko.observable(sampleDatabaseId),
collections: ko.observableArray<ViewModels.Collection>([collection]),
loadCollections: () => {},
} as ViewModels.Database;
database.findCollectionWithId = () => collection;
@ -109,6 +110,7 @@ describe("ContainerSampleGenerator", () => {
const database = {
id: ko.observable(sampleDatabaseId),
collections: ko.observableArray<ViewModels.Collection>([collection]),
loadCollections: () => {},
} as ViewModels.Database;
database.findCollectionWithId = () => collection;
collection.databaseId = database.id();

View File

@ -63,6 +63,7 @@ export class ContainerSampleGenerator {
if (!database) {
return undefined;
}
await database.loadCollections();
return database.findCollectionWithId(this.sampleDataFile.collectionId);
}