Skip to content

Commit

Permalink
Added tests for MenuPopup.getLeftPos
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-podzigun committed Dec 9, 2023
1 parent 60d8665 commit a0a8c43
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ui/test/menu/MenuPopup.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ describe("MenuPopup.test.mjs", () => {
//then
assertMenuPopup(result, props);
});

it("should calculate and return left pos when getLeftPos", () => {
//when & then
assert.deepEqual(MenuPopup.getLeftPos(10, true, 5), "0%+2");
assert.deepEqual(MenuPopup.getLeftPos(5, true, 5), "0%+0");
assert.deepEqual(MenuPopup.getLeftPos(5, true, 10), "0%+0");
assert.deepEqual(MenuPopup.getLeftPos(5, false, 5), "50%+0");
assert.deepEqual(MenuPopup.getLeftPos(10, false, 5), "50%+2");
assert.deepEqual(MenuPopup.getLeftPos(5, false, 10), "50%-5");
assert.deepEqual(MenuPopup.getLeftPos(5, false, 11), "0%+0");
});
});

/**
Expand Down

0 comments on commit a0a8c43

Please sign in to comment.