Skip to content

Commit

Permalink
Bring asset/stopper messaging to floating button.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Jan 24, 2025
1 parent c1a345a commit fce296e
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 131 deletions.
2 changes: 1 addition & 1 deletion .cypress/cypress/integration/bathnes.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ it('uses the Curo Group housing layer correctly', function() {
cy.wait('@banes-caro-group-housing-layer-tilma');
cy.wait('@report-ajax');
cy.pickCategory('Dog fouling');
cy.contains('Maintained by Curo Group').should('be.visible');
cy.get('.pre-button-messaging').contains('Maintained by Curo Group').should('be.visible');
});

it('handles code names with spaces without error', function() {
Expand Down
7 changes: 4 additions & 3 deletions .cypress/cypress/integration/highwaysengland.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ describe('National Highways cobrand tests', function() {
cy.wait('@highways-tilma');
cy.wait('@report-ajax');
cy.contains('Report a maintenance issue').should('be.visible');
cy.contains('The selected location is not maintained by us.').should('be.visible');
cy.get('.pre-button-messaging').contains('The selected location is not maintained by us.').should('be.visible');
});
it('does not allow reporting on DBFO roads', function() {
cy.get('#map_box').click(200, 249);
cy.wait('@highways-tilma');
cy.wait('@report-ajax');
cy.contains('Report a maintenance issue').should('be.visible');
cy.contains('report on roads directly maintained').should('be.visible');
cy.get('.pre-button-messaging').contains('report on roads directly maintained').should('be.visible');
});
it('allows reporting on other HE roads', function() {
cy.get('#map_box').click(240, 249);
Expand Down Expand Up @@ -76,8 +76,9 @@ describe('National Highways litter picking test', function() {
cy.wait('@highways-tilma');
cy.wait('@highways-tilma-litter');
cy.pickCategory('Flytipping');
cy.get('#map_sidebar').scrollTo('top');
cy.contains('Report a litter issue').should('be.visible');
cy.contains('litter issues on this road are handled by the local council').should('be.visible');
cy.get('.pre-button-messaging').contains('litter issues on this road are handled by the local council').should('be.visible');
});
});

Expand Down
4 changes: 1 addition & 3 deletions .cypress/cypress/integration/lincolnshire.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ describe('Lincolnshire cobrand', function(){

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', '');
cy.get('.pre-button-messaging').should('not.be.visible');
});

it('clicks through to photo section', function(){
Expand Down
3 changes: 1 addition & 2 deletions .cypress/cypress/integration/northamptonshire.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ it('prevents clicking unless asset selected, desktop flow', function() {
cy.pickCategory('Shelter Damaged');

cy.wait('@bus_stops-layer');
cy.contains(/Please select a.*bus stop.*from the map/).should('be.visible');
cy.get('#map_sidebar').scrollTo('bottom');
cy.get('.pre-button-messaging').contains(/Please select a.*bus stop.*from the map/).should('be.visible');
cy.get('.js-reporting-page--next:visible').should('be.disabled');
});

Expand Down
7 changes: 2 additions & 5 deletions .cypress/cypress/integration/oxfordshire.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ describe("Oxfordshire cobrand", function() {
cy.wait('@report-ajax');
cy.pickCategory('Lamp Out of Light');
cy.wait('@street-lights-layer');
cy.get('#map_sidebar').scrollTo('bottom');
cy.get('.js-reporting-page--next:visible').should('be.disabled');
cy.get('circle').eq(1).click(); // Click a public light
cy.get("#category_meta_message_LampOutofLight").should('not.contain', 'private street light asset');
cy.get('#map_sidebar').scrollTo('bottom');
cy.get(".pre-button-messaging").should('not.contain', 'private street light asset');
cy.get('.js-reporting-page--next:visible').should('not.be.disabled');
cy.get('circle').eq(0).click(); // Click a private light
cy.get("#category_meta_message_LampOutofLight").should('contain', 'private street light asset');
cy.get('#map_sidebar').scrollTo('bottom');
cy.get(".pre-button-messaging").should('contain', 'private street light asset');
cy.get('.js-reporting-page--next:visible').should('be.disabled');
});

Expand Down
20 changes: 10 additions & 10 deletions .cypress/cypress/integration/peterborough.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ describe('new report form', function() {
cy.pickCategory('Fallen branch');
cy.nextPageReporting();
cy.get('#form_emergency').select('yes');
cy.get('.js-post-category-messages:visible').should('contain', 'Please phone customer services to report this problem.');
cy.get('.pre-button-messaging:visible').should('contain', 'Please phone customer services to report this problem.');
cy.get('.js-reporting-page--next:visible').should('be.disabled');
cy.get('#form_emergency').select('no');
cy.get('.js-post-category-messages:visible').should('not.contain', 'Please phone customer services to report this problem.');
cy.get('.pre-button-messaging:visible').should('not.contain', 'Please phone customer services to report this problem.');
cy.get('.js-reporting-page--next:visible').should('not.be.disabled');
});

it('is hidden when private land option is yes', function() {
cy.pickCategory('Fallen branch');
cy.nextPageReporting();
cy.get('#form_private_land').select('yes');
cy.get('.js-post-category-messages:visible').should('contain', 'The council do not have powers to address issues on private land.');
cy.get('.pre-button-messaging:visible').should('contain', 'The council do not have powers to address issues on private land.');
cy.get('.js-reporting-page--next:visible').should('be.disabled');
cy.get('#form_private_land').select('no');
cy.get('.js-post-category-messages:visible').should('not.contain', 'The council do not have powers to address issues on private land.');
cy.get('.pre-button-messaging:visible').should('not.contain', 'The council do not have powers to address issues on private land.');
cy.get('.js-reporting-page--next:visible').should('not.be.disabled');
});

Expand All @@ -40,11 +40,11 @@ describe('new report form', function() {
cy.nextPageReporting();
cy.get('#js-environment-message:visible');
cy.get('#form_hazardous').select('yes');
cy.get('.js-post-category-messages:visible').should('contain', 'Please phone customer services to report this problem');
cy.get('.pre-button-messaging:visible').should('contain', 'Please phone customer services to report this problem');
cy.get('#map_sidebar').scrollTo('bottom');
cy.get('.js-reporting-page--next:visible').should('be.disabled');
cy.get('#form_hazardous').select('no');
cy.get('.js-post-category-messages:visible').should('not.contain', 'Please phone customer services to report this problem');
cy.get('.pre-button-messaging:visible').should('not.contain', 'Please phone customer services to report this problem');
cy.get('.js-reporting-page--next:visible').should('not.be.disabled');
cy.visit('http://peterborough.localhost:3001/report/new?longitude=-0.242007&latitude=52.571903');
cy.wait('@report-ajax');
Expand All @@ -68,9 +68,9 @@ describe('new report form', function() {

it('correctly changes the asset select message', function() {
cy.pickCategory('Street lighting');
cy.get('.category_meta_message').should('contain', 'You can pick a light from the map');
cy.get('.pre-button-messaging').should('contain', 'Please select a light from the map');
cy.pickCategory('Trees');
cy.get('.category_meta_message').should('contain', 'You can pick a tree from the map');
cy.get('.pre-button-messaging').should('contain', 'Please select a tree from the map');
});
});

Expand Down Expand Up @@ -117,11 +117,11 @@ describe('National site tests', function() {
cy.nextPageReporting();
cy.get('#js-environment-message:visible');
cy.get('#form_hazardous').select('yes');
cy.get('.js-post-category-messages:visible').should('contain', 'Please phone customer services to report this problem');
cy.get('.pre-button-messaging:visible').should('contain', 'Please phone customer services to report this problem');
cy.get('#map_sidebar').scrollTo('bottom');
cy.get('.js-reporting-page--next:visible').should('be.disabled');
cy.get('#form_hazardous').select('no');
cy.get('.js-post-category-messages:hidden').should('not.contain', 'Please phone customer services to report this problem');
cy.get('.pre-button-messaging:hidden').should('not.contain', 'Please phone customer services to report this problem');
cy.get('.js-reporting-page--next:visible').should('not.be.disabled');
cy.visit('http://fixmystreet.localhost:3001/report/new?longitude=-0.242007&latitude=52.571903');
cy.wait('@report-ajax');
Expand Down
2 changes: 0 additions & 2 deletions .cypress/cypress/integration/surrey.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ describe('Reporting not on a road', function() {
cy.wait('@report-ajax');
cy.pickCategory('Abandoned vehicles');
cy.contains('You cannot send Surrey County Council a report');
cy.get('#map_sidebar').scrollTo('bottom');
cy.get('.js-reporting-page--next').should('be.disabled');
cy.get('.js-reporting-page--next').should('not.be.visible');
cy.pickCategory('Flooding inside a building');
cy.contains('You cannot send Surrey County Council a report').should('not.be.visible');
cy.get('#map_sidebar').scrollTo('bottom');
cy.get('.js-reporting-page--next:visible').should('not.be.disabled');
cy.get('.js-reporting-page--next').should('be.visible');
});
Expand Down
3 changes: 1 addition & 2 deletions .cypress/cypress/integration/tfl.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ it('allows bus stop clicking outside London', function() {
// Also check a category not on a red route
cy.go('back');
cy.pickCategory('Mobile Crane Operation');
cy.get('#map_sidebar').scrollTo('top');
cy.contains('does not maintain this road').should('be.visible');
cy.get('.pre-button-messaging').contains('does not maintain this road').should('be.visible');
});

it('shows TfL roadworks', function() {
Expand Down
1 change: 1 addition & 0 deletions data/test-asset-layers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ oxfordshire:
feature_code: 'title'
asset_id_field: 'itemId'
construct_selected_asset_message: fixmystreet.assets.oxfordshire.light_construct_selected_asset_message
asset_message_when_disabled: true
actions:
asset_found: fixmystreet.assets.oxfordshire.light_asset_found
asset_not_found: fixmystreet.assets.oxfordshire.light_asset_not_found
Expand Down
Loading

0 comments on commit fce296e

Please sign in to comment.