refactor: update VS Marketplace Ratings badges for unrated extensions (#6986)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
@@ -40,6 +40,13 @@ export default class VisualStudioMarketplaceRating extends VisualStudioMarketpla
|
||||
}
|
||||
|
||||
static render({ format, averageRating, ratingCount }) {
|
||||
if (ratingCount < 1) {
|
||||
return {
|
||||
message: 'no ratings',
|
||||
color: 'inactive',
|
||||
}
|
||||
}
|
||||
|
||||
const message =
|
||||
format === 'r'
|
||||
? `${averageRating.toFixed(1)}/5 (${ratingCount})`
|
||||
|
||||
@@ -83,8 +83,8 @@ t.create('zero rating')
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'rating',
|
||||
message: '0.0/5 (0)',
|
||||
color: 'red',
|
||||
message: 'no ratings',
|
||||
color: 'lightgrey',
|
||||
})
|
||||
|
||||
t.create('stars')
|
||||
|
||||
Reference in New Issue
Block a user