Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
selfcontained committed Nov 14, 2023
1 parent 8a3210a commit c8558ed
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 0 additions & 6 deletions components/gitpod-db/src/project-db.spec.db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,11 @@ class ProjectDBSpec {
const storedProject4 = await this.projectDb.storeProject(project4);
const storedProject5 = await this.projectDb.storeProject(project5);

// TODO: omit searchTerm
const allResults = await this.projectDb.findProjectsBySearchTerm({
offset: 0,
limit: 10,
orderBy: "name",
orderDir: "ASC",
searchTerm: "",
});
expect(allResults.total).equals(5);
expect(allResults.rows.length).equal(5);
Expand All @@ -144,27 +142,23 @@ class ProjectDBSpec {
expect(allResults.rows[4].id).to.eq(storedProject5.id);

const pageSize = 3;
// TODO: omit searchTerm
const page1 = await this.projectDb.findProjectsBySearchTerm({
offset: 0,
limit: pageSize,
orderBy: "name",
orderDir: "ASC",
searchTerm: "",
});
expect(page1.total).equals(5);
expect(page1.rows.length).equal(3);
expect(page1.rows[0].id).to.eq(storedProject1.id);
expect(page1.rows[1].id).to.eq(storedProject2.id);
expect(page1.rows[2].id).to.eq(storedProject3.id);

// TODO: omit searchTerm
const page2 = await this.projectDb.findProjectsBySearchTerm({
offset: pageSize * 1,
limit: pageSize,
orderBy: "name",
orderDir: "ASC",
searchTerm: "",
});
expect(page2.total).equals(5);
expect(page2.rows.length).equal(2);
Expand Down
1 change: 1 addition & 0 deletions components/server/src/api/configuration-service-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export class ConfigurationServiceAPI implements ServiceImpl<typeof Configuration

return new ListConfigurationsResponse({
configurations: rows.map((project) => this.apiConverter.toConfiguration(project)),
// TODO: add additional pagination metadata to response
pagination: new PaginationResponse({
total,
}),
Expand Down

0 comments on commit c8558ed

Please sign in to comment.