Skip to content

Commit 95f384f

Browse files
committed
Merge branch 'main' into dev
2 parents b76cf56 + 7e87a49 commit 95f384f

35 files changed

+833
-422
lines changed

client/cypress/component/climate/ClimatePage.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('<ClimatePage />', () => {
2424
}
2525
});
2626
portalHandler.updateViewType('climate');
27-
cy.get('.map-points-list > .q-virtual-scroll__content')
27+
cy.get('.map-points-list > div')
2828
.children()
2929
.first()
3030
.click();

client/cypress/component/groundwater-level/GroundwaterLevel.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('<GroundwaterLevel />', () => {
3131
}
3232
});
3333
portalHandler.updateViewType('wells');
34-
cy.get('.q-virtual-scroll__content > .q-item:nth-child(1)').click();
34+
cy.get('.map-points-list > div:nth-child(1) > .q-item').click();
3535
// details are displayed
3636
cy.get('.selected-point > pre:nth-child(1)').should('not.be.empty');
3737
cy.get('.q-btn > span > span').contains('View More').click();

client/cypress/component/groundwater/Groundwater.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ describe('<GroundWaterQuality />', () => {
4040
});
4141
portalHandler.updateViewType('ground');
4242
cy.wait(1000);
43-
cy.get('.map-points-list > .q-virtual-scroll__content')
43+
cy.get('.map-points-list > div')
4444
.children()
4545
.first()
4646
.click();
4747
cy.wait(1000);
48-
cy.get('.q-virtual-scroll__content > .q-item:first').click();
48+
cy.get('.map-points-list > div:nth-child(1) > .q-item').click();
4949
// details are displayed
5050
cy.get('.selected-point').should('not.be.empty');
5151
// open report

client/cypress/component/surfacewater/SurfaceWater.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('<SurfaceWater />', () => {
3131
}
3232
});
3333
portalHandler.updateViewType('surface');
34-
cy.get('.q-virtual-scroll__content > .q-item:nth-child(1)').click();
34+
cy.get('.map-points-list > div:nth-child(1) > .q-item').click();
3535
// details are displayed
3636
cy.get('.selected-point > pre:nth-child(1)').should('not.be.empty');
3737
// open report

client/cypress/component/watershed/Watershed.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('<Watershed />', () => {
1212
});
1313
it('opens station details', () => {
1414
cy.mount(Watershed)
15-
cy.get('.q-virtual-scroll__content').children().first().click();
15+
cy.get('map-points-list').children().first().click();
1616
cy.get('.selected-point').should('exist').and('be.visible');
1717
});
1818
it('opens watershed report', () => {

client/cypress/component/watershed/report/Allocations.cy.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,50 +45,50 @@ describe('<Allocations />', () => {
4545
});
4646
const allocationRow = reportData.allocations[0];
4747
// check the test data matches the content displayed
48-
cy.get('.q-table > tbody > tr > td:nth-child(1) > p:nth-child(1)').should('have.text', allocationRow.licensee);
49-
cy.get('.q-table > tbody > tr > td:nth-child(1) > p:nth-child(2)').should('contain', allocationRow.purpose).and('contain', allocationRow.stream_name);
50-
cy.get('.q-table > tbody > tr > td:nth-child(2) > p:nth-child(2)').should('contain', 'File # ' + allocationRow.file_no)
51-
cy.get('.q-table > tbody > tr > td:nth-child(3) > p:nth-child(1)').should('contain', allocationRow.pod);
52-
cy.get('.q-table > tbody > tr > td:nth-child(3) > p:nth-child(2)').should('contain', allocationRow.well_tag_number);
53-
cy.get('.q-table > tbody > tr > td:nth-child(4) > p:nth-child(1)').then(text => {
48+
49+
cy.get('[data-cy="license"] > p:nth-child(1)').should('have.text', allocationRow.licensee);
50+
cy.get('[data-cy="license"] > p:nth-child(2)').should('contain', allocationRow.purpose).and('contain', allocationRow.stream_name);
51+
cy.get('[data-cy="number"] > p:nth-child(2)').should('contain', 'File # ' + allocationRow.file_no)
52+
cy.get('[data-cy="pod"] > p:nth-child(1)').should('contain', allocationRow.pod);
53+
cy.get('[data-cy="pod"] > p:nth-child(2)').should('contain', allocationRow.well_tag_number);
54+
cy.get('[data-cy="date"] > p:nth-child(1)').then(text => {
5455
assert(text[0].innerHTML.includes(formatDate(allocationRow.start_date, 'dd mmm yyyy', ' ')));
55-
})
56-
cy.get('.q-table > tbody > tr > td:nth-child(4) > p:nth-child(1)').should('contain', formatDate(allocationRow.start_date, 'dd mmm yyyy', ' '));
57-
cy.get('.q-table > tbody > tr > td:nth-child(4) > p:nth-child(2)').should('contain', formatDate(allocationRow.priority_date, 'dd mmm yyyy', ' '));
58-
cy.get('.q-table > tbody > tr > td:nth-child(4) > p:nth-child(3)').should('contain', formatDate(allocationRow.expiry_date, 'dd mmm yyyy', ' '));
59-
cy.get('.q-table > tbody > tr > td:nth-child(4) > p:nth-child(4)').should('contain', formatDate(allocationRow.lic_status_date, 'dd mmm yyyy', ' '));
60-
cy.get('.q-table > tbody > tr > td:nth-child(5)').should('contain', "1,234.0");
61-
cy.get('.q-table > tbody > tr > td:nth-child(6)').should('contain', allocationRow.qty_flag);
62-
cy.get('.q-table > tbody > tr > td:nth-child(7) > div').should('have.class', allocationRow.lic_type);
63-
cy.get('.q-table > tbody > tr > td:nth-child(7) > div').should('contain', allocationRow.lic_type);
64-
cy.get('.q-table > tbody > tr > td:nth-child(8) > .q-icon').should('have.class', 'mdi-check-circle').and('have.class', 'text-green-5')
56+
});
57+
cy.get('[data-cy="date"] > p:nth-child(1)').should('contain', formatDate(allocationRow.start_date, 'dd mmm yyyy', ' '));
58+
cy.get('[data-cy="date"] > p:nth-child(2)').should('contain', formatDate(allocationRow.priority_date, 'dd mmm yyyy', ' '));
59+
cy.get('[data-cy="date"] > p:nth-child(3)').should('contain', formatDate(allocationRow.expiry_date, 'dd mmm yyyy', ' '));
60+
cy.get('[data-cy="date"] > p:nth-child(4)').should('contain', formatDate(allocationRow.lic_status_date, 'dd mmm yyyy', ' '));
61+
cy.get('[data-cy="quantity"]').should('contain', "1,234.0");
62+
cy.get('[data-cy="flag"]').should('contain', allocationRow.qty_flag);
63+
cy.get('[data-cy="type"] > div').should('have.class', allocationRow.lic_type);
64+
cy.get('[data-cy="type"] > div').should('contain', allocationRow.lic_type);
65+
cy.get('[data-cy="status"] > .q-icon').should('have.class', 'mdi-check-circle').and('have.class', 'text-green-5')
6566
})
6667
it('sets and resets filters', () => {
6768
cy.mount(Allocations, {
6869
props: {
6970
reportContent: reportData
7071
}
7172
});
72-
const allocationRow = reportData.allocations[0];
7373
// check value exists before filtering
74-
cy.get('.q-table > tbody > tr > td:nth-child(5)').should('contain', "1,234.0");
74+
cy.get('[data-cy="quantity"]').should('contain', "1,234.0");
7575
cy.get('.mdi-filter').click()
7676
cy.get('.q-checkbox__label').contains('Surface Water').click()
77-
cy.get('.q-table > tbody > tr > td:nth-child(5)').should('not.exist');
77+
cy.get('[data-cy="quantity"]').should('not.exist');
7878
cy.get('.q-checkbox__label').contains('Surface Water').click()
79-
cy.get('.q-table > tbody > tr > td:nth-child(5)').should('contain', "1,234.0");
79+
cy.get('[data-cy="quantity"]').should('contain', "1,234.0");
8080
cy.get('.q-checkbox__label').contains('Application').click()
81-
cy.get('.q-table > tbody > tr > td:nth-child(5)').should('not.exist');
81+
cy.get('[data-cy="quantity"]').should('not.exist');
8282
cy.get('.q-checkbox__label').contains('Application').click();
8383
cy.get('.q-checkbox__label').contains('Agriculture').click();
84-
cy.get('.q-table > tbody > tr > td:nth-child(5)').should('not.exist');
84+
cy.get('[data-cy="quantity"]').should('not.exist');
8585
cy.get('.q-checkbox__label').contains('Agriculture').click();
86-
cy.get('.q-table > tbody > tr > td:nth-child(5)').should('contain', "1,234.0");
86+
cy.get('[data-cy="quantity"]').should('contain', "1,234.0");
8787
cy.get('input[placeholder="Text Search"]').type('TESTING')
88-
cy.get('.q-table > tbody > tr > td:nth-child(5)').should('not.exist');
88+
cy.get('[data-cy="quantity"]').should('not.exist');
8989
cy.get('input[placeholder="Text Search"]').clear()
9090
cy.get('input[placeholder="Text Search"]').type('Cypress')
91-
cy.get('.q-table > tbody > tr > td:nth-child(5)').should('contain', "1,234.0");
91+
cy.get('[data-cy="quantity"]').should('contain', "1,234.0");
9292
cy.get('span').contains('Reset Filters').click();
9393
cy.get('input[placeholder="Text Search"]').should('have.value', '');
9494
})

client/cypress/component/watershed/report/Landcover.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('<Landcover />', () => {
1010
reportContent
1111
}
1212
});
13-
cy.get('h1').should('contain', 'Landcover');
13+
cy.get('.text-h4').should('contain', 'Landcover');
1414
cy.get('#landcover-pie-chart > svg > g > path:nth-child(2)')
1515
.should('have.attr', 'd')
1616
.and('eq', 'M0,-185A185,185,0,1,1,-123.473,-137.766L0,0Z');

client/cypress/component/watershed/report/MonthlyHydrology.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('<MonthlyHydrology />', () => {
1010
reportContent
1111
}
1212
});
13-
cy.get('.monthly-hydrology-header > h1').should('contain', ' Monthly Water Supply and Demand - Twain Creek');
14-
cy.get('.monthly-hydrology-header > h1').should('contain', ' Monthly Water Supply and Demand - Babine River');
13+
cy.get('.monthly-hydrology-header > .text-h4').should('contain', ' Monthly Water Supply and Demand - Twain Creek');
14+
cy.get('.monthly-hydrology-header > .text-h4').should('contain', ' Monthly Water Supply and Demand - Babine River');
1515
});
1616
});

client/cypress/component/watershed/report/WatershedOverview.cy.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ describe('<WatershedOverview />', () => {
1010
reportContent
1111
}
1212
});
13-
cy.get('.q-timeline__content > .q-timeline__title').contains('Twain Creek');
14-
cy.get('.q-timeline__content > .q-timeline__title').contains('Babine River');
15-
cy.get('.q-timeline__content > .q-timeline__title').contains('Skeena River');
16-
cy.get('h2').contains('Twain Creek');
1713
cy.get('.overview-line').children().eq(1).should('contain', '54.606° N, -125.821° W');
1814
cy.get('.overview-line').children().eq(3).should('contain', '50.60 km2');
1915
cy.get('.overview-line').children().eq(5).should('contain', '1349.81 m (max), 1169.53 m (mean), 1021.41 m (min),');
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import WatershedSummary from '@/components/watershed/report/WatershedSummary.vue';
2+
import reportContent from '../../../fixtures/watershedReport.json';
3+
4+
describe('WatershedSummary.vue', () => {
5+
it('mounts and renders content', () => {
6+
cy.mount(WatershedSummary, {
7+
props: {
8+
reportContent
9+
}
10+
});
11+
cy.get('.text-h5').contains('Twain Creek');
12+
cy.get('.q-timeline__content > .q-timeline__title').contains('Twain Creek');
13+
cy.get('.q-timeline__content > .q-timeline__title').contains('Babine River');
14+
cy.get('.q-timeline__content > .q-timeline__title').contains('Skeena River');
15+
});
16+
});

0 commit comments

Comments
 (0)