Attempt to fix tests

This commit is contained in:
Danielv123 committed 2025-08-10 00:28:48 +02:00
1 parent 630a0d3898
commit 89b6d5aa13
3 files changed
+20 -10

No files matched your search

+16 -10
View File
@@ -590,7 +590,7 @@ export default function CanvasMinimapPage() {
if (!resp.positions) { return null; } if (!resp.positions) { return null; }
const binStr = atob(resp.positions); const binStr = atob(resp.positions);
const buf = new Uint8Array(binStr.length); const buf = new Uint8Array(binStr.length);
for (let i=0; i<binStr.length; i++) { buf[i] = binStr.charCodeAt(i); } for (let i = 0; i < binStr.length; i++) { buf[i] = binStr.charCodeAt(i); }
playerPathBufRef.current = buf; playerPathBufRef.current = buf;
// Parse and deduplicate positions immediately after loading // Parse and deduplicate positions immediately after loading
@@ -936,11 +936,11 @@ export default function CanvasMinimapPage() {
useEffect(() => { useEffect(() => {
const isTypingInInput = (): boolean => { const isTypingInInput = (): boolean => {
const activeElement = document.activeElement; const activeElement = document.activeElement;
if (!activeElement) return false; if (!activeElement) { return false; }
const tagName = activeElement.tagName.toLowerCase(); const tagName = activeElement.tagName.toLowerCase();
const inputTypes = ['input', 'textarea', 'select']; const inputTypes = ["input", "textarea", "select"];
const isContentEditable = activeElement.getAttribute('contenteditable') === 'true'; const isContentEditable = activeElement.getAttribute("contenteditable") === "true";
// Check if it's an input field or contenteditable element // Check if it's an input field or contenteditable element
if (inputTypes.includes(tagName) || isContentEditable) { if (inputTypes.includes(tagName) || isContentEditable) {
@@ -948,9 +948,9 @@ export default function CanvasMinimapPage() {
} }
// Check if it's an Ant Design Select dropdown (they use divs with specific classes) // Check if it's an Ant Design Select dropdown (they use divs with specific classes)
if (activeElement.closest('.ant-select-dropdown') || if (activeElement.closest(".ant-select-dropdown")
activeElement.closest('.ant-select-selector') || || activeElement.closest(".ant-select-selector")
activeElement.classList.contains('ant-select-selection-search-input')) { || activeElement.classList.contains("ant-select-selection-search-input")) {
return true; return true;
} }
@@ -2220,7 +2220,9 @@ export default function CanvasMinimapPage() {
value: instance.id, value: instance.id,
label: instance.name, label: instance.name,
}))} }))}
suffixIcon={selectedInstance ? undefined : <span style={{ color: "#ff4d4f" }}>Required</span>} suffixIcon={selectedInstance
? undefined
: <span style={{ color: "#ff4d4f" }}>Required</span>}
/> />
</Space> </Space>
</Col> </Col>
@@ -2342,7 +2344,9 @@ export default function CanvasMinimapPage() {
textAlign: "right", textAlign: "right",
}} }}
> >
{showChartTags ? `${getVisibleChartTags().length} shown` : "Hidden"} {showChartTags
? `${getVisibleChartTags().length} shown`
: "Hidden"}
</Text> </Text>
</div> </div>
</div> </div>
@@ -2402,7 +2406,9 @@ export default function CanvasMinimapPage() {
textAlign: "right", textAlign: "right",
}} }}
> >
{showPlayerPositions ? `${playerPositions.size} online` : "Hidden"} {showPlayerPositions
? `${playerPositions.size} online`
: "Hidden"}
</Text> </Text>
</div> </div>
</div> </div>
+3
View File
@@ -15,10 +15,12 @@ const { selectTargetCommand, initialize: initializeCtl } = require("@clusterio/c
// Make sure permissions from plugins are loaded // Make sure permissions from plugins are loaded
require("../../plugins/global_chat/dist/node/index"); require("../../plugins/global_chat/dist/node/index");
require("../../plugins/minimap/dist/node/index");
require("../../plugins/player_auth/dist/node/index"); require("../../plugins/player_auth/dist/node/index");
require("../../plugins/research_sync/dist/node/index"); require("../../plugins/research_sync/dist/node/index");
require("../../plugins/statistics_exporter/dist/node/index"); require("../../plugins/statistics_exporter/dist/node/index");
require("../../plugins/subspace_storage/dist/node/index"); require("../../plugins/subspace_storage/dist/node/index");
require("../../plugins/inventory_sync/dist/node/index");
class TestControl extends lib.Link { class TestControl extends lib.Link {
constructor(connector, subscribe = true) { constructor(connector, subscribe = true) {
@@ -319,6 +321,7 @@ before(async function() {
await execCtlProcess("plugin add ../../plugins/subspace_storage"); await execCtlProcess("plugin add ../../plugins/subspace_storage");
await execCtlProcess("plugin add ../../plugins/inventory_sync"); await execCtlProcess("plugin add ../../plugins/inventory_sync");
await execCtlProcess("plugin add ../../plugins/player_auth"); await execCtlProcess("plugin add ../../plugins/player_auth");
await execCtlProcess("plugin add ../../plugins/minimap");
console.log("Bootstrapping"); console.log("Bootstrapping");
await execController("bootstrap create-admin test"); await execController("bootstrap create-admin test");
+1
View File
@@ -39,6 +39,7 @@ describe("Clusterio Instance", function() {
for (const plugin of [ for (const plugin of [
"global_chat", "research_sync", "statistics_exporter", "subspace_storage", "player_auth", "inventory_sync", "global_chat", "research_sync", "statistics_exporter", "subspace_storage", "player_auth", "inventory_sync",
"minimap",
]) { ]) {
await execCtl(`instance config set ${instName} ${plugin}.load_plugin false`); await execCtl(`instance config set ${instName} ${plugin}.load_plugin false`);
} }