Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Refactor existing work on dynamic E2E tests #496

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
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
Loading