"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const strict_1 = __importDefault(require("node:assert/strict"));
const node_test_1 = require("node:test");
const reference_data_1 = require("@firestone-hs/reference-data");
const hand_minion_priority_1 = require("../../src/services/hand-minion-priority");
const asMinion = (partial) => ({
    maxHealth: 1,
    locked: false,
    ...partial,
});
(0, node_test_1.describe)('getHighestAttackHandMinions', () => {
    (0, node_test_1.it)('returns highest attack first; ties keep hand order', () => {
        const hand = [
            asMinion({ cardId: 'A', attack: 2 }),
            asMinion({ cardId: 'B', attack: 5 }),
            asMinion({ cardId: 'C', attack: 5 }),
        ];
        const typeUpper = () => reference_data_1.CardType[reference_data_1.CardType.MINION];
        const out = (0, hand_minion_priority_1.getHighestAttackHandMinions)(hand, 2, (e) => !!e.maxHealth && (0, hand_minion_priority_1.isHandMinionCandidate)(e, typeUpper));
        strict_1.default.equal(out.length, 2);
        strict_1.default.equal(out[0].cardId, 'B');
        strict_1.default.equal(out[1].cardId, 'C');
    });
    (0, node_test_1.it)('respects count and empty hand', () => {
        strict_1.default.deepEqual((0, hand_minion_priority_1.getHighestAttackHandMinions)([], 2, () => true), []);
        strict_1.default.deepEqual((0, hand_minion_priority_1.getHighestAttackHandMinions)([asMinion({ cardId: 'X', attack: 1 })], 0, () => true), []);
    });
});
//# sourceMappingURL=hand-minion-priority.test.js.map