Skip to content

Commit

Permalink
Fix issue #390.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmacarthur committed Sep 15, 2024
1 parent 2a35d4a commit 6dbf3da
Show file tree
Hide file tree
Showing 5 changed files with 410 additions and 681 deletions.
39 changes: 39 additions & 0 deletions packages/typeit/__tests__/TypeIt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,45 @@ beforeEach(() => {
element = document.querySelector("#element");
});

describe("setting cursor options", () => {
test("can set cursor to true", () => {
return new Promise((resolve) => {
args[1].cursor = true;
args[1].afterComplete = resolve;

new TypeIt(...args).go();
});
});

test("can set cursor to false", () => {
return new Promise((resolve) => {
args[1].cursor = false;
args[1].afterComplete = resolve;

new TypeIt(...args).go();
});
});

test("can set cursor to object", () => {
return new Promise((resolve) => {
args[1].cursor = {
animation: {
frames: [],
options: {
iterations: Infinity,
easing: "linear",
fill: "forwards",
},
},
};

args[1].afterComplete = resolve;

new TypeIt(...args).go();
});
});
});

test("Initial queue only contains startDelay pause.", () => {
args[1].strings = [];
instance = new TypeIt(...args);
Expand Down
2 changes: 1 addition & 1 deletion packages/typeit/examples/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ new TypeIt("#example13", {
function () {
console.log("fire!");
},
{ delay: 2000 }
{ delay: 2000 },
)
.move(-5, { delay: 2000 })
.go();
Expand Down
Loading

0 comments on commit 6dbf3da

Please sign in to comment.