Skip to content

Commit

Permalink
feat: create form submissions data migrations (#3651)
Browse files Browse the repository at this point in the history
Co-authored-by: Leonardo Giacone <leonardo.giacone@gmail.com>
Co-authored-by: Leonardo Giacone <leonardo@webiny.com>
  • Loading branch information
3 people committed Oct 31, 2023
1 parent c436f3c commit bf6849c
Show file tree
Hide file tree
Showing 25 changed files with 15,306 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ describe("5.38.0-001", () => {
const dynamoToEsTable = getDynamoToEsTable();
const elasticsearchClient = createElasticsearchClient();

beforeAll(async () => {
process.env.ELASTIC_SEARCH_INDEX_PREFIX =
new Date().toISOString().replace(/\.|\:/g, "-").toLowerCase() + "-";

await elasticsearchClient.indices.deleteAll();
});
afterEach(async () => {
await elasticsearchClient.indices.deleteAll();
});

logTestNameBeforeEachTest();

it("should not run if no forms found", async () => {
Expand Down Expand Up @@ -97,6 +107,17 @@ describe("5.38.0-001", () => {
...createLocalesData()
]);

await insertElasticsearchTestData(elasticsearchClient, createEsFormsData(), item => {
return esGetIndexName({
tenant: item.tenant,
locale: item.locale,
isHeadlessCmsModel: false,
type: "form-builder"
});
});

await elasticsearchClient.indices.refreshAll();

const handler = createDdbEsMigrationHandler({
primaryTable,
dynamoToEsTable,
Expand Down

0 comments on commit bf6849c

Please sign in to comment.