Skip to content

Commit

Permalink
fix(core): ScenarioParameters now requires Description to be provided
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-molak committed Jan 2, 2021
1 parent 463047b commit cfa4800
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/model/ScenarioParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class ScenarioParameters extends TinyType {
public static fromJSON(o: JSONObject) {
return new ScenarioParameters(
Name.fromJSON(o.name as string),
o.description && Description.fromJSON(o.description as string),
Description.fromJSON(o.description as string),
(o as any).values,
);
}
Expand All @@ -20,6 +20,7 @@ export class ScenarioParameters extends TinyType {
super();

ensure('name', name, isDefined());
ensure('description', description, isDefined());
ensure('values', values, isDefined());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ describe('FeatureFileMapper', () => {
));
expect(outline.parameters[49]).to.equal(new ScenarioParameters(
new Name(''),
undefined,
new Description(''),
{ parameter: 'value one' },
));

Expand All @@ -291,12 +291,12 @@ describe('FeatureFileMapper', () => {
));
expect(outline.parameters[60]).to.equal(new ScenarioParameters(
new Name(''),
undefined,
new Description(''),
{ username: 'admin', password: 'P@ssw0rd1' },
));
expect(outline.parameters[61]).to.equal(new ScenarioParameters(
new Name(''),
undefined,
new Description(''),
{ username: 'editor', password: 'P@ssw0rd2' },
));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class FeatureFileMapper {

const
exampleSetName = new Name(examples.name),
exampleSetDescription = examples.description && new Description(examples.description),
exampleSetDescription = new Description(examples.description || ''),
variableCells = examples.tableHeader.cells;

examples.tableBody.forEach(values => {
Expand Down

0 comments on commit cfa4800

Please sign in to comment.