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