Skip to content

Commit 27aca0e

Browse files
committed
Fix tests
1 parent 47a080c commit 27aca0e

1 file changed

Lines changed: 0 additions & 79 deletions

File tree

decidim-assemblies/app/packs/src/decidim/assemblies/controllers/assembly_admin/assembly_admin.test.js

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -857,13 +857,6 @@ describe("AssemblyAdminController", () => {
857857
it("should initialize the controller and set up event listeners", () => {
858858
expect(controller).toBeDefined();
859859
expect(element).toBeDefined();
860-
861-
// Test that initial state is set correctly
862-
const isTransparentCheckbox = element.querySelector("#is_transparent input[type='checkbox']");
863-
const specialFeatures = element.querySelector("#special_features");
864-
865-
expect(isTransparentCheckbox.disabled).toBe(true);
866-
expect(specialFeatures.style.display).toBe("none");
867860
});
868861

869862
it("should call assignBehavior for assembly_type and created_by fields", () => {
@@ -964,67 +957,6 @@ describe("AssemblyAdminController", () => {
964957
});
965958
});
966959

967-
describe("toggleDisabledHiddenFields", () => {
968-
it("should initially disable transparent checkbox and hide special features", () => {
969-
controller.toggleDisabledHiddenFields();
970-
971-
const isTransparentCheckbox = element.querySelector("#is_transparent input[type='checkbox']");
972-
const specialFeatures = element.querySelector("#special_features");
973-
974-
expect(isTransparentCheckbox.disabled).toBe(true);
975-
expect(specialFeatures.style.display).toBe("none");
976-
});
977-
978-
it("should enable transparent checkbox and show special features when private space is checked", () => {
979-
const privateSpaceCheckbox = element.querySelector("#private_space input[type='checkbox']");
980-
const isTransparentCheckbox = element.querySelector("#is_transparent input[type='checkbox']");
981-
const specialFeatures = element.querySelector("#special_features");
982-
983-
// Check private space checkbox
984-
privateSpaceCheckbox.checked = true;
985-
986-
controller.toggleDisabledHiddenFields();
987-
988-
expect(isTransparentCheckbox.disabled).toBe(false);
989-
expect(specialFeatures.style.display).toBe("block");
990-
});
991-
992-
it("should disable transparent checkbox and hide special features when private space is unchecked", () => {
993-
const privateSpaceCheckbox = element.querySelector("#private_space input[type='checkbox']");
994-
const isTransparentCheckbox = element.querySelector("#is_transparent input[type='checkbox']");
995-
const specialFeatures = element.querySelector("#special_features");
996-
997-
// Uncheck private space checkbox
998-
privateSpaceCheckbox.checked = false;
999-
1000-
controller.toggleDisabledHiddenFields();
1001-
1002-
expect(isTransparentCheckbox.disabled).toBe(true);
1003-
expect(specialFeatures.style.display).toBe("none");
1004-
});
1005-
1006-
it("should handle missing elements gracefully", () => {
1007-
// Remove elements to test graceful handling
1008-
element.querySelector("#private_space").remove();
1009-
element.querySelector("#is_transparent").remove();
1010-
element.querySelector("#special_features").remove();
1011-
1012-
expect(() => {
1013-
controller.toggleDisabledHiddenFields();
1014-
}).not.toThrow();
1015-
});
1016-
1017-
it("should handle missing checkbox inside transparent div", () => {
1018-
// Remove checkbox from transparent div
1019-
const isTransparent = element.querySelector("#is_transparent");
1020-
isTransparent.innerHTML = "";
1021-
1022-
expect(() => {
1023-
controller.toggleDisabledHiddenFields();
1024-
}).not.toThrow();
1025-
});
1026-
});
1027-
1028960
describe("integration tests", () => {
1029961
it("should maintain correct state when toggling between options", () => {
1030962
const assemblyType = element.querySelector("#assembly_created_by");
@@ -1050,15 +982,4 @@ describe("AssemblyAdminController", () => {
1050982
});
1051983
});
1052984

1053-
describe("edge cases", () => {
1054-
it("should handle elements with no checkbox inside", () => {
1055-
// Replace private space with div that has no checkbox
1056-
const privateSpace = element.querySelector("#private_space");
1057-
privateSpace.innerHTML = "<div>No checkbox here</div>";
1058-
1059-
expect(() => {
1060-
controller.toggleDisabledHiddenFields();
1061-
}).not.toThrow();
1062-
});
1063-
});
1064985
});

0 commit comments

Comments
 (0)