feat : improve import UI
CI / Verify (push) Successful in 1m15s
CI / Build immutable images and deploy (push) Successful in 1m50s

This commit is contained in:
2026-09-08 19:23:05 +07:00 Unverified
parent cd66d498ab
commit d85a48be25
5 changed files with 579 additions and 113 deletions
+16
View File
@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
import {
applyTeamFields,
cloneTeamImports,
findInvalidTeamCatalogReference,
findUnsupportedTeamWeapon,
limitPresets,
@@ -144,6 +145,21 @@ describe("team bulk tools", () => {
});
});
it("clones imported teams with new ids and independent members", () => {
const source = team("source");
const transfer = {
title: source.title,
rotationSeconds: source.rotationSeconds,
combo: source.combo,
members: source.members,
};
const imported = cloneTeamImports([transfer], () => "imported-1");
expect(imported[0]).toEqual({ ...source, clientId: "imported-1" });
expect(imported[0].members).not.toBe(source.members);
expect(imported[0].members[0]).not.toBe(source.members[0]);
});
it("rejects malformed and unsupported team transfers", () => {
expect(() => parseTeamTransfer("not-json")).toThrow();
expect(() => parseTeamTransfer(JSON.stringify({