aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 -->