Skip to content

Commit 22422b5

Browse files
committed
test: fix circle progress tests
1 parent a6f67b6 commit 22422b5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/unit/circle/circle.spec.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from "chai";
22
import Circle from "@/components/Circle/Circle.vue";
33
import HalfCircle from "@/components/Circle/HalfCircle.vue";
44
import VueEllipseProgress from "@/components/VueEllipseProgress.vue";
5-
import { dotParser, calcThickness } from "@/components/optionsParser";
5+
import { dotParser, calcThickness, animationParser } from "@/components/optionsParser";
66
import { factory, setCircleProps } from "@/../tests/helper";
77

88
const localFactory = (props, container = Circle) => factory({ container, props });
@@ -20,7 +20,7 @@ describe("[ CircleProgress.vue | HalfCircleProgress.vue ]", () => {
2020
progress,
2121
thickness,
2222
emptyThickness: thickness,
23-
animation: "default 0 0",
23+
animation: animationParser("default 0 0"),
2424
});
2525
it("calculates the progress circle stroke offset correctly", () => {
2626
const radius = size / 2 - thickness / 2;
@@ -31,7 +31,7 @@ describe("[ CircleProgress.vue | HalfCircleProgress.vue ]", () => {
3131
});
3232
it("calculates the negative progress circle stroke offset correctly", async () => {
3333
progress = -50;
34-
await wrapper.setProps({ options: { ...wrapper.props().options, progress } });
34+
await setCircleProps(wrapper, { progress });
3535
const radius = size / 2 - thickness / 2;
3636
const circumference = radius * 2 * Math.PI;
3737
const expectedOffset = circumference - (progress / 100) * circumference;
@@ -48,8 +48,7 @@ describe("[ CircleProgress.vue | HalfCircleProgress.vue ]", () => {
4848
});
4949
it("lets progress circle visible for -1 < progress < 1", async () => {
5050
progress = 0;
51-
await wrapper.setProps({ options: { ...wrapper.props().options, half: true } });
52-
await setCircleProps(wrapper, { half: true });
51+
await setCircleProps(wrapper, { progress, half: true });
5352
const radius = size / 2 - thickness / 2;
5453
const circumference = radius * 2 * Math.PI;
5554

0 commit comments

Comments
 (0)