fixed some failing jasmine tests stemming from previous commit
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@@ -127,10 +127,30 @@ describe("RoleSelect", () => {
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------ //
|
||||
// room:roles_revealed event //
|
||||
// room:all_roles_filled event //
|
||||
// ------------------------------------------------------------------ //
|
||||
|
||||
describe("room:roles_revealed event", () => {
|
||||
describe("room:all_roles_filled event", () => {
|
||||
let pickSigsWrap;
|
||||
|
||||
beforeEach(() => {
|
||||
pickSigsWrap = document.createElement("div");
|
||||
pickSigsWrap.id = "id_pick_sigs_wrap";
|
||||
pickSigsWrap.style.display = "none";
|
||||
testDiv.appendChild(pickSigsWrap);
|
||||
});
|
||||
|
||||
it("shows #id_pick_sigs_wrap", () => {
|
||||
window.dispatchEvent(new CustomEvent("room:all_roles_filled", { detail: {} }));
|
||||
expect(pickSigsWrap.style.display).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------ //
|
||||
// room:sig_select_started event //
|
||||
// ------------------------------------------------------------------ //
|
||||
|
||||
describe("room:sig_select_started event", () => {
|
||||
let reloadCalled;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -143,7 +163,7 @@ describe("RoleSelect", () => {
|
||||
});
|
||||
|
||||
it("triggers a page reload", () => {
|
||||
window.dispatchEvent(new CustomEvent("room:roles_revealed", { detail: {} }));
|
||||
window.dispatchEvent(new CustomEvent("room:sig_select_started", { detail: {} }));
|
||||
expect(reloadCalled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -485,7 +485,7 @@ describe("Tray", () => {
|
||||
expect(firstCell.classList.contains("arc-in")).toBe(true);
|
||||
});
|
||||
|
||||
it("removes .arc-in and force-closes after animationend", () => {
|
||||
it("removes .arc-in and closes after animationend", () => {
|
||||
Tray.placeCard("PC", null);
|
||||
expect(Tray.isOpen()).toBe(true);
|
||||
firstCell.dispatchEvent(new Event("animationend"));
|
||||
@@ -497,6 +497,10 @@ describe("Tray", () => {
|
||||
let called = false;
|
||||
Tray.placeCard("PC", () => { called = true; });
|
||||
firstCell.dispatchEvent(new Event("animationend"));
|
||||
// Simulate the close transition completing (portrait: 'left' property)
|
||||
const te = new Event("transitionend");
|
||||
te.propertyName = "left";
|
||||
wrap.dispatchEvent(te);
|
||||
expect(called).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user