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

Update runner to design system v18 #155

Merged
merged 6 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ load-schemas:
./scripts/load_release.sh onsdigital/eq-questionnaire-schemas $(SCHEMAS_VERSION)

load-templates:
./scripts/load_release.sh onsdigital/design-system 17.2.0
./scripts/load_release.sh onsdigital/design-system 18.1.0

build: load-templates
make translate
Expand Down
1 change: 1 addition & 0 deletions templates/partials/answers/currency.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"name": answer.id,
"value": input._value() | e,
"label": {
"id": answer.id + "-label",
rmccar marked this conversation as resolved.
Show resolved Hide resolved
"text": answer.label,
"description": answer.description
},
Expand Down
1 change: 1 addition & 0 deletions templates/partials/answers/dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"id": answer.id,
"name": select.name,
"label": {
"id": answer.id + "-label",
"text": answer.label,
"description": answer.description
},
Expand Down
1 change: 1 addition & 0 deletions templates/partials/answers/number.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"id": answer.id,
"type": "number",
"label": {
"id": answer.id + "-label",
"text": answer.label,
"description": answer.description
},
Expand Down
1 change: 1 addition & 0 deletions templates/partials/answers/percentage.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"classes": "js-totaliser-input-calculated" if answer.calculated,
"type": "number",
"label": {
"id": answer.id + "-label",
"text": answer.label,
"description": answer.description
},
Expand Down
1 change: 1 addition & 0 deletions templates/partials/answers/textarea.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"id": answer.id,
"name": input.name,
"label": {
"id": answer.id + "-label",
"text": answer.label,
"description": answer.description
},
Expand Down
1 change: 1 addition & 0 deletions templates/partials/answers/textfield.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"name": input.name,
"value": input._value() | e,
"label": {
"id": answer.id + "-label",
"text": answer.label,
"description": answer.description
},
Expand Down
1 change: 1 addition & 0 deletions templates/partials/answers/unit.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"name": input.name,
"value": input._value() | e,
"label": {
"id": answer.id + "-label",
"text": answer.label,
"description": answer.description
},
Expand Down
2 changes: 1 addition & 1 deletion templates/question.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
onsPanel({
"type": "error",
"classes": "u-mb-s",
"title": ngettext('This page has an error', 'This page has %(num)s errors', form.mapped_errors|length),
"title": ngettext('This page has an error', 'This page has %(num)s errors', form.mapped_errors | length),
"attributes": {
"data-qa": "error-body"
}
Expand Down
5 changes: 4 additions & 1 deletion tests/functional/generate_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@
)

ANSWER_LABEL_DESCRIPTION_GETTER = Template(
r""" ${answerName}LabelDescription() { return `label[for=${answerId}] > .label__description`; }
r""" ${answerName}LabelDescription() {
return `#${answerId}-label-description-hint`;
}

"""
)
Expand Down Expand Up @@ -298,6 +300,7 @@ def process_options(answer_id, options, page_spec, base_prefix):

page_spec.write(ANSWER_GETTER.substitute(option_context))
page_spec.write(ANSWER_LABEL_GETTER.substitute(option_context))
page_spec.write(ANSWER_LABEL_DESCRIPTION_GETTER.substitute(option_context))

# Add a selector for an option which exposes another input, e.g.
# an 'Other' option which exposes a text input for the user to fill in
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/spec/checkbox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Checkbox with "other" option', () => {
});

it('Given an "other" option is available, when the user clicks the "other" option the other input should be visible.', () => {
expect($(MandatoryCheckboxPage.otherLabel()).getText()).to.have.string("Choose any other topping");
expect($(MandatoryCheckboxPage.otherLabelDescription()).getText()).to.have.string("Choose any other topping");
$(MandatoryCheckboxPage.other()).click();
expect($(MandatoryCheckboxPage.otherDetail()).isDisplayed()).to.be.true;
});
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/spec/relationships.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe("Relationships", () => {
it("And go to the first relationship, Then the 'Brother or Sister' option should have the text 'Including half brother or half sister'", () => {
$(ListCollectorPage.no()).click();
$(ListCollectorPage.submit()).click();
expect($(RelationshipsPage.brotherOrSisterLabel()).getText()).to.contain("Including half brother or half sister");
expect($(RelationshipsPage.brotherOrSisterLabelDescription()).getText()).to.contain("Including half brother or half sister");
});

it("And go to the second relationship, Then the previous link should return to the first relationship", () => {
Expand Down