feat : improve import UI
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user