aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Mytton <chrism@mysociety.org>2020-02-06 17:26:18 +0000
committerChris Mytton <chrism@mysociety.org>2020-02-26 16:02:19 +0000
commit152f8f4e608abc5029104e652f4ef37d4cfe02cb (patch)
treeb0a94b28e045f1382933b098386e192ed7708b9d
parentfe19f00769d48828d049959eecf00e81b142eda3 (diff)
[Buckinghamshire] Change "Name" to "Full name" on forms
Since we require the user to enter their full name Buckinghamshire have asked us to change the text to "Full name" to make it clearer that the full name is required to complete the form.
-rw-r--r--.cypress/cypress/integration/buckinghamshire.js14
-rw-r--r--templates/web/buckinghamshire/report/form/user_name.html13
2 files changed, 27 insertions, 0 deletions
diff --git a/.cypress/cypress/integration/buckinghamshire.js b/.cypress/cypress/integration/buckinghamshire.js
index d5b14100a..6e87da624 100644
--- a/.cypress/cypress/integration/buckinghamshire.js
+++ b/.cypress/cypress/integration/buckinghamshire.js
@@ -5,6 +5,7 @@ describe('flytipping', function() {
cy.fixture('roads.xml');
cy.route('**mapserver/bucks*Whole_Street*', 'fixture:roads.xml').as('roads-layer');
cy.route('/report/new/ajax*').as('report-ajax');
+ cy.route('/around/nearby*').as('around-ajax');
cy.visit('http://buckinghamshire.localhost:3001/');
cy.contains('Buckinghamshire');
cy.get('[name=pc]').type('SL9 0NX');
@@ -51,4 +52,17 @@ describe('flytipping', function() {
cy.get('[name=site_code]').should('have.value', '7300268');
});
+ it('uses the label "Full name" for the name field', function() {
+ cy.get('#map_box').click(290, 307);
+ cy.wait('@report-ajax');
+ cy.get('select:eq(4)').select('Flytipping');
+ cy.wait('@around-ajax');
+ cy.get('.js-hide-duplicate-suggestions:first').should('be.visible').click();
+
+ cy.get('[name=title]').type('Title');
+ cy.get('[name=detail]').type('Detail');
+ cy.get('.js-new-report-user-show').click();
+ cy.get('label[for=form_name]').should('contain', 'Full name');
+ });
+
});
diff --git a/templates/web/buckinghamshire/report/form/user_name.html b/templates/web/buckinghamshire/report/form/user_name.html
new file mode 100644
index 000000000..0cefb1b1d
--- /dev/null
+++ b/templates/web/buckinghamshire/report/form/user_name.html
@@ -0,0 +1,13 @@
+<!-- user_name.html -->
+<label for="form_name">Full name
+[% TRY %]
+ [% INCLUDE 'report/form/after_name.html' %]
+ [% CATCH file %]
+[% END %]
+</label>
+[% IF field_errors.name %]
+ <p class='form-error'>[% field_errors.name %]</p>
+[% END %]
+<input type="text" class="form-control [% valid_class OR 'validName' %] js-form-name [% extra_class %]"
+ value="[% object.name || c.user.name | html %]" name="name" id="form_name">
+<!-- /user_name.html -->