Skip to content

Commit

Permalink
[Lincs] Make asset_item_message for road assets an empty string
Browse files Browse the repository at this point in the history
Was previously 'null', which was throwing an error in
fixmystreet/assets.js->get_asset_pick_message().
  • Loading branch information
nephila-nacrea authored and dracos committed Feb 28, 2022
1 parent d6e5c39 commit 46ff04f
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .cypress/cypress/integration/lincolnshire.js
@@ -0,0 +1,49 @@
describe('Lincolnshire cobrand', function(){
describe('making a report as a new user', function() {
before(function(){
cy.server();
cy.route('/report/new/ajax*').as('report-ajax');

cy.visit('http://lincolnshire.localhost:3001/report/new?longitude=-0.502566&latitude=52.656144');
cy.contains('Lincolnshire County Council');

cy.wait('@report-ajax');
});

it('does not display extra message when selecting a "road" category', function(){
cy.pickCategory('Damaged/missing cats eye');
cy.get(
'#category_meta_message_Damagedmissingcatseye'
).should('have.text', '');
});

it('clicks through to photo section', function(){
cy.nextPageReporting();
cy.contains('Drag photos here').should('be.visible');
});

it('clicks through to public details page', function(){
cy.nextPageReporting();
cy.contains('Public details').should('be.visible');
});

it('cannot click through to next page without details', function(){
cy.nextPageReporting();
cy.get('#form_title-error').should('be.visible');
});

it('submits public details form with sufficient details', function(){
cy.get('#form_title').type('Missing cat\'s eye');
cy.get('#form_detail').type('This cat must be a pirate');
cy.nextPageReporting();
cy.get('#form_name').should('be.visible');
});

it('submits personal details form with sufficient details', function(){
cy.get('#form_name').type('Kitty Wake');
cy.get('#form_username_register').type('a@b.com');
cy.get('#mapForm').submit();
cy.contains('Nearly done! Now check your email…').should('be.visible');
});
});
});
1 change: 1 addition & 0 deletions bin/browser-tests
Expand Up @@ -21,6 +21,7 @@ BEGIN {
highwaysengland
hounslow
isleofwight
lincolnshire
northamptonshire
oxfordshire
peterborough
Expand Down
1 change: 1 addition & 0 deletions bin/fixmystreet.com/fixture
Expand Up @@ -120,6 +120,7 @@ if ($opt->test_fixtures) {
{ area_id => 2483, categories => [ 'Potholes', 'Other' ], name => 'Hounslow Borough Council' },
{ area_id => 2508, categories => [ 'Potholes', 'Other' ], name => 'Hackney Council' },
{ area_id => 2636, categories => [ 'Potholes', 'Private', 'Extra' ], name => 'Isle of Wight Council' },
{ area_id => 2232, categories => ['Damaged/missing cats eye'], name => 'Lincolnshire County Council' },
{ area_id => 2566, categories => [ 'General fly tipping', 'Fallen branch', 'Light Out', 'Light Dim', 'Fallen Tree', 'Damaged Tree', 'Pothole' ], name => 'Peterborough City Council' },
{ area_id => 2498, categories => [ 'Incorrect timetable', 'Glass broken', 'Mobile Crane Operation', 'Roadworks' ], name => 'TfL' },
{ area_id => 2237, categories => [ 'Flytipping', 'Roads', 'Parks' ], name => 'Oxfordshire County Council' },
Expand Down
2 changes: 1 addition & 1 deletion web/cobrands/lincolnshire/assets.js
Expand Up @@ -131,7 +131,7 @@ fixmystreet.assets.add(defaults, {
"Road surface issue"
],
asset_item: 'road',
asset_item_message: null,
asset_item_message: '',
disable_pin_snapping: true,
stylemap: fixmystreet.assets.stylemap_invisible
});
Expand Down

0 comments on commit 46ff04f

Please sign in to comment.