this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

more fixes

alice 56295d66 1ec3dd4c

+27 -4
+15 -3
index.test.ts
··· 5 5 6 6 // Mock necessary DOM elements and event listeners 7 7 beforeEach(() => { 8 + // Mock window.alert to prevent blocking tests 9 + window.alert = () => {}; // Replace alert with a non-blocking empty function 10 + 8 11 // The happy-dom environment should provide localStorage automatically. 9 12 // We still need to clear it before each test if the environment doesn't do it automatically. 10 13 if (typeof window !== 'undefined' && window.localStorage) { ··· 74 77 if (state.cards.length < 3) { 75 78 throw new Error("Test setup failed: Initial state should have at least 3 cards for this test."); 76 79 } 77 - state.cards[0].column = 'veryImportant'; 78 - state.cards[1].column = 'important'; 79 - state.cards[2].column = 'veryImportant'; 80 + // Assign ALL cards to avoid blocking the transition due to the unassigned check 81 + state.cards.forEach((card, index) => { 82 + if (index === 0) { 83 + card.column = 'veryImportant'; 84 + } else if (index === 1) { 85 + card.column = 'important'; 86 + } else if (index === 2) { 87 + card.column = 'veryImportant'; 88 + } else { 89 + card.column = 'notImportant'; // Assign all others 90 + } 91 + }); 80 92 app.updateState(state); 81 93 82 94 // Act: Simulate clicking the button
+12 -1
index.ts
··· 89 89 // Navigation buttons 90 90 document.getElementById("toPart2")?.addEventListener("click", () => { 91 91 const newState = this.undoManager.getState(); 92 + // Check for unassigned cards before proceeding 93 + const unassignedCount = newState.cards.filter(card => card.column === 'unassigned').length; 94 + if (unassignedCount > 0) { 95 + alert(`Please sort all ${unassignedCount} unassigned value(s) before proceeding to Part 2.`); 96 + return; 97 + } 92 98 newState.currentPart = "part2"; 93 - // Filter and map cards in one step 94 99 newState.cards = newState.cards 95 100 .filter(card => card.column === "veryImportant") 96 101 .map(card => ({ ...card, column: "unassigned" })); ··· 112 117 }); 113 118 document.getElementById("toPart3")?.addEventListener("click", () => { 114 119 const newState = this.undoManager.getState(); 120 + // Check for unassigned cards before proceeding 121 + const unassignedCount = newState.cards.filter(card => card.column === 'unassigned').length; 122 + if (unassignedCount > 0) { 123 + alert(`Please sort all ${unassignedCount} unassigned value(s) before proceeding.`); 124 + return; 125 + } 115 126 const veryImportantCards = newState.cards.filter((c) => c.column === "veryImportant"); 116 127 const veryImportantCount = veryImportantCards.length; 117 128