Skip to content

Commit 65d2658

Browse files
committed
Add check for getRandomColor
1 parent b04a42b commit 65d2658

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/tests/Myr.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ describe("Updates to Myr's Model", () => {
133133
});
134134

135135
it("to makes Random Color", () => {
136+
myr.cursor.color = null;
136137
let color = myr.getRandomColor();
137138
expect(color).not.toBeUndefined();
139+
expect(myr.cursor.color).toBeNull();
138140
expect(colorRegEx.test(color)).toBeTruthy();
139141
});
140142

@@ -146,7 +148,9 @@ describe("Updates to Myr's Model", () => {
146148

147149
it("pick Random Color out of a list of colors", () => {
148150
let colors = ["blue", "green", "red", "hotpink", "FF00FF", "rgb(100,33,93)"];
151+
myr.cursor.color = null;
149152
let color = myr.getRandomColor(colors);
153+
expect(myr.cursor.color).toBeNull();
150154
expect(color).not.toBeUndefined();
151155
expect(colors.includes(color)).toBeTruthy();
152156
});

0 commit comments

Comments
 (0)