Skip to content

Commit

Permalink
tests: Refactor existing work on dynamic E2E tests (#496)
Browse files Browse the repository at this point in the history
* feat: Hotfixes (#492)

* draft: docs: Caching documentation (#460)

* docs: initial documentation templates

* docs: add other headers

* docs: overview of readpage

* docs: add db schema

* docs: more caching process documentation

* terraform-docs: automated action

* docs: Update CMS schema diagram

* docs: Add dbdiagram code for schema

* docs: Finish Contentful caching process doc

* docs: initial documentation templates

* docs: add other headers

* docs: overview of readpage

* docs: add db schema

* docs: more caching process documentation

* docs: Update CMS schema diagram

* docs: Add dbdiagram code for schema

* docs: Finish Contentful caching process doc

* docs: wip templates for adrs

* docs: draft highlevel mapping info

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: handle textBodyDB entity being empty - possible fix

* Linted Code in Dfe.PlanTech.Domain/

* ignore mapping of rich text id

* fix: Check answers page title (#487)

* fix: check answers page title

* fix: remove line

* Linted Code in Dfe.PlanTech.Web/

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat: Add caching docs (#486)

* docs: initial documentation templates

* docs: add other headers

* docs: overview of readpage

* docs: add db schema

* docs: more caching process documentation

* terraform-docs: automated action

* docs: Update CMS schema diagram

* docs: Add dbdiagram code for schema

* docs: Finish Contentful caching process doc

* docs: initial documentation templates

* docs: add other headers

* docs: overview of readpage

* docs: add db schema

* docs: more caching process documentation

* docs: Update CMS schema diagram

* docs: Add dbdiagram code for schema

* docs: Finish Contentful caching process doc

* docs: wip templates for adrs

* docs: draft highlevel mapping info

* docs: pad out adrs

* docs: add caching adr

* docs: Expand contentful caching process

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Support preview mode in Content db (#489)

* wip

* feat: process options

* feat: support preview in cmsdbcontext

* tests: tests for save + autosave

* feat: add contentfuloptions to web proj

* fix: add default usepreview

* fix: correctly get ContentfulOptions in dbcontext

* chore: remove unneeded param, add docs

* chore: refactor ignore message condition

* fix: Azure Function Tests (#490)

* fix: Add parameterless constructor again to fix tests

* chore: code cleanup recommendations

* fix: Remove this.getservice as causing errors

* fix: service config issue

* refactor: use guard statement for cleaner code

* refactor: create only adds contentcomponent

* refactor: revert changes and skip create event

* refactor: only save or auto_save when a new entity has all its required fields

* test: update tests

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: uahussain12 <“umar.hussain@and.digital”>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: uahussain12 <uahussain12@users.noreply.github.com>
Co-authored-by: Zac King <zac.king@and.digital>
Co-authored-by: Iain STANGER <Iain.STANGER@EDUCATION.GOV.UK>
Co-authored-by: Zac <119302767+Zac-AND-Digital@users.noreply.github.com>

* wip: validating pages dynamically

* wip: validate textbodies

* wip

* wip: move validations to separate files

* feat: validate paragraphs

* feat: validate table

* feat: use class, add comments

* chore: rearrange files

* chore: add docs

* chore: delete moved files

* fix: missing comma

* refactor: cleanup duplicated code.

* merge development

* chore: delete old dupe files

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: uahussain12 <“umar.hussain@and.digital”>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: uahussain12 <uahussain12@users.noreply.github.com>
Co-authored-by: Zac King <zac.king@and.digital>
Co-authored-by: Iain STANGER <Iain.STANGER@EDUCATION.GOV.UK>
Co-authored-by: Zac <119302767+Zac-AND-Digital@users.noreply.github.com>
  • Loading branch information
8 people authored Feb 6, 2024
1 parent 9edcad1 commit dee960a
Show file tree
Hide file tree
Showing 31 changed files with 171 additions and 901 deletions.
File renamed without changes.
5 changes: 5 additions & 0 deletions contentful/export-processor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contentful Export Processing

Classes/functions/etc to process exported Contentful entries for various purposes.

[Test Suite Generator](./user-journey/README.md)
11 changes: 11 additions & 0 deletions contentful/export-processor/content-types/content-types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Answer } from "./answer";
import ContentType from "./content-type";
import { Question } from "./question";
import { Recommendation } from "./recommendation";
import { Section } from "./section";

const exportObj = {
ContentTypes: [Answer, ContentType, Question, Recommendation, Section],
};

export default exportObj;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Answer } from "./answer";
import { Answer } from "./answer.js";

export class Question {
answers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fs from "fs";
import { Recommendation } from "./recommendation";
import { Question } from "./question";
import { UserJourney } from "./user-journey";
import { UserJourney } from "../user-journey/user-journey";

export class Section {
recommendations;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Section } from "./section";
import ContentType from "./content-type";
import { Section } from "./content-types/section";
import ContentType from "./content-types/content-type";

/**
* DataMapper class for mapping and combining data from a file
Expand Down
6 changes: 6 additions & 0 deletions contentful/export-processor/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import DataMapper from "./data-mapper";
import ContentTypes from "./content-types/content-types";

const exportObj = { DataMapper, ...ContentTypes };

export default exportObj;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import fs from "fs";
import DataMapper from "./data-mapper.mjs";
import DataMapper from "../data-mapper";
import fs from "fs";

const { file, writeAllPossiblePaths } = getArguments();

const dataMapper = new DataMapper(file);
const contentfulData = fs.readFileSync(file, "utf8");
const parsed = JSON.parse(contentfulData);
const dataMapper = new DataMapper(parsed);

for (const section of dataMapper.mappedSections) {
const output = dataMapper.convertToMinimalSectionInfo(
Expand Down
13 changes: 0 additions & 13 deletions contentful/user-journey-scripts/answer.mjs

This file was deleted.

240 changes: 0 additions & 240 deletions contentful/user-journey-scripts/data-mapper.mjs

This file was deleted.

Empty file.
9 changes: 0 additions & 9 deletions contentful/user-journey-scripts/question-answer.mjs

This file was deleted.

15 changes: 0 additions & 15 deletions contentful/user-journey-scripts/question.mjs

This file was deleted.

8 changes: 0 additions & 8 deletions contentful/user-journey-scripts/runner.mjs

This file was deleted.

Loading

0 comments on commit dee960a

Please sign in to comment.