Add SymfonyInsight stars badge, run [SymfonyInsight sensiolabs amo chrome-web-store redmine spigetratings vaadin-directory visualstudiomarketplacerating wordpress] (#2971)
* feat: added stars badge for symfony insight * refactor: changed symfony star determination logic * feat: updating symfony to handle old scan scenarios * feat: updated symfony insight to handle older projects * tests: removed another test for symfony insight per request
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
const moment = require('moment')
|
||||
moment().format()
|
||||
|
||||
function starRating(rating) {
|
||||
function starRating(rating, max = 5) {
|
||||
const flooredRating = Math.floor(rating)
|
||||
let stars = ''
|
||||
while (stars.length < flooredRating) {
|
||||
@@ -23,7 +23,8 @@ function starRating(rating) {
|
||||
} else if (decimal >= 0.125) {
|
||||
stars += '¼'
|
||||
}
|
||||
while (stars.length < 5) {
|
||||
|
||||
while (stars.length < max) {
|
||||
stars += '☆'
|
||||
}
|
||||
return stars
|
||||
|
||||
@@ -23,6 +23,7 @@ describe('Text formatters', function() {
|
||||
given(2.566).expect('★★½☆☆')
|
||||
given(2.2).expect('★★¼☆☆')
|
||||
given(3).expect('★★★☆☆')
|
||||
given(2, 4).expect('★★☆☆')
|
||||
})
|
||||
|
||||
test(currencyFromCode, () => {
|
||||
|
||||
Reference in New Issue
Block a user