Create clean release database baseline
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
||||
} from "../src/db/database-context.js";
|
||||
import { ProjectHistoryRepository } from "../src/db/repositories/project-history.repository.js";
|
||||
import { ProjectLocationStructureProjectCommandRepository } from "../src/db/repositories/project-location-structure-project-command.repository.js";
|
||||
import { consumers } from "../src/db/schema/consumers.js";
|
||||
import { distributionBoards } from "../src/db/schema/distribution-boards.js";
|
||||
import { floors } from "../src/db/schema/floors.js";
|
||||
import { projectRevisions } from "../src/db/schema/project-revisions.js";
|
||||
@@ -423,53 +422,6 @@ describe("project-location structure project command", () => {
|
||||
floorContext.close();
|
||||
}
|
||||
|
||||
const roomContext = createTestDatabase();
|
||||
try {
|
||||
const repository =
|
||||
new ProjectLocationStructureProjectCommandRepository(
|
||||
roomContext.db
|
||||
);
|
||||
const room = createProjectRoomSnapshot("project-1", {
|
||||
roomNumber: "001",
|
||||
roomName: "Technik",
|
||||
});
|
||||
const inserted = repository.execute({
|
||||
projectId: "project-1",
|
||||
expectedRevision: 0,
|
||||
source: "user",
|
||||
command: createProjectRoomInsertProjectCommand(room),
|
||||
});
|
||||
roomContext.db
|
||||
.insert(consumers)
|
||||
.values({
|
||||
id: "legacy-consumer-1",
|
||||
projectId: "project-1",
|
||||
roomId: room.id,
|
||||
name: "Bestand",
|
||||
quantity: 1,
|
||||
installedPowerPerUnitKw: 1,
|
||||
demandFactor: 1,
|
||||
})
|
||||
.run();
|
||||
const undoStep = new ProjectHistoryRepository(
|
||||
roomContext.db
|
||||
).getNextCommand("project-1", "undo");
|
||||
assert.ok(undoStep);
|
||||
assert.throws(
|
||||
() =>
|
||||
repository.execute({
|
||||
projectId: "project-1",
|
||||
expectedRevision: 1,
|
||||
source: "undo",
|
||||
historyTargetChangeSetId: undoStep.changeSetId,
|
||||
command: inserted.inverse,
|
||||
}),
|
||||
/referenced project room/
|
||||
);
|
||||
} finally {
|
||||
roomContext.close();
|
||||
}
|
||||
|
||||
const rollbackContext = createTestDatabase();
|
||||
try {
|
||||
rollbackContext.sqlite.exec(`
|
||||
|
||||
Reference in New Issue
Block a user