Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

[BUG] Fixed team feedback bugs #100

Merged
merged 6 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion components/ContinuousField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
type="number"
:step="step"
class="numberinput form-control"
min="0"
:min="min"
@input="updateField"
/>
</div>
Expand All @@ -18,6 +18,10 @@
<script>
export default {
props: {
min: {
type: String,
default: '0',
},
name: {
type: String,
required: true,
Expand Down
3 changes: 1 addition & 2 deletions components/QueryForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
</template>
</categorical-field>
<continuous-field
min="1"
name="Minimum number of sessions"
data-cy="min-num-sessions-field"
step="1"
Expand Down Expand Up @@ -151,8 +152,6 @@ export default {
validateQueryForm() {
if (this.minAge && this.maxAge && Number(this.minAge) > Number(this.maxAge)) {
this.displayToast('The value of maximum age field must be greater than or equal to the value of minimum age field');
} else if (this.min_num_sessions === '0') {
this.displayToast('The value for minimum number of sessions field must be greater than 0');
} else {
this.submitQuery();
}
Expand Down
6 changes: 0 additions & 6 deletions cypress/component/QueryForm.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,5 @@ describe('Query form', () => {
cy.get('[data-cy="submit-query"]').click();
// See https://stackoverflow.com/questions/71295432/unable-to-see-toast-in-cypress/71301155#71301155
cy.contains('#b-toaster-top-right', 'The value of maximum age field must be greater than or equal to the value of minimum age field');

cy.get('[data-cy="Min Age-continuous-field-input"]').clear();
cy.get('[data-cy="Max Age-continuous-field-input"]').clear();
cy.get('[data-cy="Minimum number of sessions-continuous-field-input"]').type(0);
cy.get('[data-cy="submit-query"]').click();
cy.contains('#b-toaster-top-right', 'The value for minimum number of sessions field must be greater than 0');
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/DatasetResultsTSV.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ const response = [
];

describe('Dataset results TSV', () => {
it('Intercepts the request sent to the API and asserts over the request url', () => {
it('Removes a newline character from a dataset name in the downloaded results file', () => {
cy.intercept('query/?*', response).as('call');
cy.visit('/');
cy.get('[data-cy="submit-query"]').click();
cy.get('[data-cy="select-all"]').check();
cy.get('[data-cy="download-results-button"]').click();
cy.readFile('cypress/downloads/dataset-results.tsv').should('not.contain', 'some\nname');
cy.readFile('cypress/downloads/dataset-results.tsv').should('contain', 'some name');
});
});