Persist circuit reorders
This commit is contained in:
@@ -36,6 +36,7 @@ import {
|
||||
import { createCircuitDeviceRowInsertProjectCommand } from "../src/domain/models/circuit-device-row-structure-project-command.model.js";
|
||||
import { createCircuitUpdateProjectCommand } from "../src/domain/models/circuit-project-command.model.js";
|
||||
import { createCircuitSectionReorderProjectCommand } from "../src/domain/models/circuit-section-reorder-project-command.model.js";
|
||||
import { createCircuitSectionsReorderProjectCommand } from "../src/domain/models/circuit-sections-reorder-project-command.model.js";
|
||||
import { createCircuitSectionRenumberProjectCommand } from "../src/domain/models/circuit-section-renumber-project-command.model.js";
|
||||
import { createCircuitInsertProjectCommand } from "../src/domain/models/circuit-structure-project-command.model.js";
|
||||
import { createProjectDeviceRowSyncProjectCommand } from "../src/domain/models/project-device-row-sync-project-command.model.js";
|
||||
@@ -764,6 +765,34 @@ describe("project command service", () => {
|
||||
{ id: "circuit-2", sortOrder: 20 },
|
||||
]
|
||||
);
|
||||
|
||||
const multiSection = createService(context).executeUser({
|
||||
projectId: "project-1",
|
||||
expectedRevision: 2,
|
||||
command: createCircuitSectionsReorderProjectCommand([
|
||||
{
|
||||
sectionId: firstCircuit.sectionId,
|
||||
assignments:
|
||||
createCircuitSectionReorderProjectCommand(
|
||||
firstCircuit.sectionId,
|
||||
[
|
||||
{
|
||||
circuitId: "circuit-1",
|
||||
expectedSortOrder: 10,
|
||||
targetSortOrder: 20,
|
||||
},
|
||||
{
|
||||
circuitId: "circuit-2",
|
||||
expectedSortOrder: 20,
|
||||
targetSortOrder: 10,
|
||||
},
|
||||
]
|
||||
).payload.assignments,
|
||||
},
|
||||
]),
|
||||
});
|
||||
assert.equal(multiSection.history.currentRevision, 3);
|
||||
assert.equal(multiSection.history.redoDepth, 0);
|
||||
} finally {
|
||||
context.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user