Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto committed Nov 30, 2024
1 parent 7ea9fd1 commit 5309f97
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions ts/src/action/orchestrator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,30 +84,6 @@ import { randomEmail } from "../testutils/db/value";
import { toDBColumnOrTable } from "../names/names";

const edges = ["edge", "inverseEdge", "symmetricEdge"];
beforeEach(async () => {
// does assoc_edge_config loader need to be cleared?
for (const edge of edges) {
await createRowForTest({
tableName: "assoc_edge_config",
fields: {
edge_table: toDBColumnOrTable(edge, "table"),
symmetric_edge: edge == "symmetricEdge",
inverse_edge_type: edge === "edge" ? "inverseEdge" : "edge",
edge_type: edge,
edge_name: "name",
created_at: new Date(),
updated_at: new Date(),
},
onConflict: {
onConflictCols: ["edge_type"],
},
});
}
});

afterEach(() => {
FakeComms.clear();
});

const UserSchema = getBuilderSchemaFromFields(
{
Expand Down Expand Up @@ -529,6 +505,31 @@ function getInsertUserBuilder(
}

function commonTests() {
beforeAll(async () => {
// does assoc_edge_config loader need to be cleared?
for (const edge of edges) {
await createRowForTest({
tableName: "assoc_edge_config",
fields: {
edge_table: toDBColumnOrTable(edge, "table"),
symmetric_edge: edge == "symmetricEdge",
inverse_edge_type: edge === "edge" ? "inverseEdge" : "edge",
edge_type: edge,
edge_name: "name",
created_at: new Date(),
updated_at: new Date(),
},
onConflict: {
onConflictCols: ["edge_type"],
},
});
}
});

afterEach(() => {
FakeComms.clear();
});

test("schema on create", async () => {
const builder = getInsertUserBuilder(
new Map([
Expand Down

0 comments on commit 5309f97

Please sign in to comment.