Skip to content

Commit dd1b403

Browse files
committed
fix: renterd no recommendations
1 parent 49cd9db commit dd1b403

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

.changeset/small-cameras-lay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'renterd': minor
3+
---
4+
5+
The recommendations now say "no recommendations" instead of 0. Closes https://github.com/SiaFoundation/desktop/issues/90

apps/renterd-e2e/src/specs/config.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ test('system offers recommendations', async ({ page }) => {
276276

277277
await expect(
278278
page.getByText(
279-
/(0 recommendations to match with more hosts|Configuration matches with a sufficient number of hosts)/
279+
/(No recommendations to match with more hosts|Configuration matches with a sufficient number of hosts)/
280280
)
281281
).toBeVisible()
282282

@@ -294,7 +294,7 @@ test('system offers recommendations', async ({ page }) => {
294294
await clearToasts({ page })
295295
// There are now recommendations.
296296
await expect(
297-
page.getByText('0 recommendations to match with more hosts')
297+
page.getByText('No recommendations to match with more hosts')
298298
).toBeHidden()
299299

300300
// Apply all recommendations.
@@ -347,7 +347,7 @@ test('recommendations work with pinned fields', async ({ page }) => {
347347
await fillTextInputByName(page, 'maxDownloadPriceTB', '100')
348348
// There are now recommendations.
349349
await expect(
350-
page.getByText('0 recommendations to match with more hosts')
350+
page.getByText('No recommendations to match with more hosts')
351351
).toBeHidden()
352352

353353
// Set to high mixed values that will not need any recommendations.
@@ -357,14 +357,14 @@ test('recommendations work with pinned fields', async ({ page }) => {
357357
await fillTextInputByName(page, 'maxDownloadPriceTB', '100000000')
358358
await expect(
359359
page.getByText(
360-
/(0 recommendations to match with more hosts|Configuration matches with a sufficient number of hosts)/
360+
/(No recommendations to match with more hosts|Configuration matches with a sufficient number of hosts)/
361361
)
362362
).toBeVisible()
363363

364364
// Set the pinned max storage price to a low USD value equivalent to 100 SC.
365365
await fillTextInputByName(page, 'maxStoragePriceTBMonthPinned', '0.39')
366366
// There are now recommendations again.
367367
await expect(
368-
page.getByText('0 recommendations to match with more hosts')
368+
page.getByText('No recommendations to match with more hosts')
369369
).toBeHidden()
370370
})

apps/renterd/components/Config/Recommendations.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ export function Recommendations() {
177177
{usableHostsCurrent}/{hostTarget50}
178178
</Text>
179179
<Text size="16" weight="medium">
180-
{recommendations.length === 1
180+
{recommendations.length === 0
181+
? 'No recommendations'
182+
: recommendations.length === 1
181183
? '1 recommendation'
182184
: `${recommendations.length} recommendations`}{' '}
183185
to match with more hosts

0 commit comments

Comments
 (0)