Skip to content

Commit 1d7c165

Browse files
author
NarrowsProjects
committed
EXPERIMENT: re-use the new queryBuilder but do not add the view.
1 parent 93a167f commit 1d7c165

2 files changed

Lines changed: 5 additions & 16 deletions

File tree

lib/usecases/environment/GetAllEnvironmentsUseCase.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const { statusAcronyms } = require('../../domain/enums/StatusAcronyms.js');
2424
const { unpackNumberRange } = require('../../utilities/rangeUtils.js');
2525
const { splitStringToStringsTrimmed } = require('../../utilities/stringUtils.js');
2626
const { setTimeRangeQuery } = require('../../utilities/setTimeRangeQuery.js');
27+
// const { environmentSummary } = require('../../server/views/environments/summary.js');
2728

2829
/**
2930
* Subquery to select the latest history item for each environment.
@@ -70,10 +71,7 @@ class GetAllEnvironmentsUseCase {
7071
const { filter, page = {} } = query;
7172
const { limit = ApiConfig.pagination.limit, offset = 0 } = page;
7273

73-
const queryBuilder = dataSource.createQueryBuilder(true)
74-
.orderBy('updatedAt', 'desc')
75-
.limit(limit)
76-
.offset(offset);
74+
const queryBuilder = dataSource.createQueryBuilder().orderBy('updatedAt', 'desc').limit(limit).offset(offset);
7775

7876
if (filter) {
7977
const {
@@ -193,6 +191,8 @@ class GetAllEnvironmentsUseCase {
193191

194192
queryBuilder.include({ association: 'runs' });
195193
queryBuilder.include({ association: 'historyItems' });
194+
// console.log(queryBuilder.toImplementation());
195+
196196
const { count, rows } = await EnvironmentRepository.findAndCountAll(queryBuilder);
197197
return {
198198
count,

test/public/envs/detailsPage.test.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,7 @@ module.exports = () => {
111111
);
112112

113113
await waitForNavigation(page, () => pressElement(page, '#env-overview'));
114-
try {
115-
await waitForNavigation(page, () => pressElement(page, '#rowDxi029djX a:first-of-type'));
116-
} catch {
117-
for (let i = 0; i < 100; i++) {
118-
console.log('Test failed waiting 10 seconds to see if it is an timing issue');
119-
}
120-
await new Promise((res, _rej) => {
121-
setTimeout(()=> res(), 10000);
122-
});
123-
124-
await waitForNavigation(page, () => pressElement(page, '#rowDxi029djX a:first-of-type'));
125-
}
114+
await waitForNavigation(page, () => pressElement(page, '#rowDxi029djX a:first-of-type'));
126115
await pressElement(page, '#raw-configuration-tab');
127116

128117
await expectInnerText(

0 commit comments

Comments
 (0)