Skip to content

Commit 585a13f

Browse files
committed
Update tests
1 parent 1b25cad commit 585a13f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

cypress/fixtures/rating.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"show": true,
5151
"fontSize": 28,
5252
"bold": true,
53-
"roundingValue": 1,
53+
"roundingValue": 0,
5454
"position": "bottom",
5555
"offsetY": 0,
5656
"offsetX": 0

cypress/fixtures/smiley.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"show": true,
4343
"fontSize": 28,
4444
"bold": true,
45-
"roundingValue": 1,
45+
"roundingValue": 0,
4646
"position": "bottom",
4747
"offsetY": 0,
4848
"offsetX":0

src/components/vue-ui-rating.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('<VueUiRating />', () => {
4242
return Math.min(fixture.config.to, Math.max(fixture.config.from, averageRating));
4343
}
4444

45-
const staticRating = calculateAverageRating(fixture.dataset.rating).toFixed(fixture.config.style.rating.roundingValue)
45+
const staticRating = Math.round(calculateAverageRating(fixture.dataset.rating))
4646

4747
cy.get(`[data-cy="rating-title"]`)
4848
.should('exist')
@@ -139,7 +139,7 @@ describe('<VueUiRating />', () => {
139139
.click();
140140

141141
cy.get(`[data-cy="rating-position-bottom"]`)
142-
.contains(`${i + 1}.0`)
142+
.contains(`${i + 1}`)
143143
}
144144

145145
cy.wait(100).then(() => {

src/components/vue-ui-smiley.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('<VueUiSmiley />', () => {
4343
return averageRating;
4444
}
4545

46-
const staticRating = calculateAverageRating(fixture.dataset.rating).toFixed(fixture.config.style.rating.roundingValue);
46+
const staticRating = Math.round(calculateAverageRating(fixture.dataset.rating))
4747

4848
cy.get(`[data-cy="smiley-title"]`)
4949
.should('exist')
@@ -63,7 +63,7 @@ describe('<VueUiSmiley />', () => {
6363
.click();
6464

6565
cy.get(`[data-cy="smiley-position-bottom"]`)
66-
.contains(`${i + 1}.0`)
66+
.contains(`${i + 1}`)
6767
}
6868

6969
let modifiedConfig = {
@@ -86,7 +86,7 @@ describe('<VueUiSmiley />', () => {
8686

8787
cy.get(`[data-cy="smiley-tooltip-${i}"]`)
8888
.should('exist')
89-
.contains(`${Object.keys(fixture.dataset.rating)[i]} : ${fixture.dataset.rating[i + 1]}`)
89+
.contains(`${Object.keys(fixture.dataset.rating)[i]}: ${fixture.dataset.rating[i + 1]}`)
9090
}
9191
});
9292
});

0 commit comments

Comments
 (0)