From c84ee5e409fef09b9c91b1388648dac6c641c7c5 Mon Sep 17 00:00:00 2001 From: jhouse Date: Wed, 12 Feb 2020 15:32:46 +0900 Subject: [PATCH] Adding more tests to libraries Fixed bug when switching libs --- .../src/main/resources/static/js/common.js | 2 +- .../libraries/searchOwnedMovies.js | 28 +++++++++++++++++-- package.json | 2 +- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/GapsWeb/src/main/resources/static/js/common.js b/GapsWeb/src/main/resources/static/js/common.js index 1f6a1f0..e7dfd58 100644 --- a/GapsWeb/src/main/resources/static/js/common.js +++ b/GapsWeb/src/main/resources/static/js/common.js @@ -15,7 +15,7 @@ export function getMoviesForTable(url, movieContainer, noMovieContainer, moviesT contentType: "application/json; charset=utf-8", dataType: "json", success: function (result) { - if (result.code = 40) { + if (result.code === 40) { movieContainer.show(100); noMovieContainer.css({'display': 'none'}); moviesTable.rows.add(result.extras).draw(); diff --git a/cypress/integration/libraries/searchOwnedMovies.js b/cypress/integration/libraries/searchOwnedMovies.js index 83ea0e3..241bf72 100644 --- a/cypress/integration/libraries/searchOwnedMovies.js +++ b/cypress/integration/libraries/searchOwnedMovies.js @@ -13,9 +13,15 @@ describe('Find owned movies', function () { cy.get('.card-body > .btn') .click(); - cy.get(':nth-child(1) > .sorting_1 > .card > .row > .col-md-10 > .card-body > .card-title') - .should('have.text', '101 Dalmatians II Patch\'s London Adventure (2003)'); + cy.get('label > input') + .clear() + .type('101 Dalmatians'); + cy.get('.col-md-10 > .card-body > .card-title') + .should('have.text', '101 Dalmatians II Patch\'s London Adventure (2003)'); + }); + + it('Refresh Disney Movies', () => { cy.get('#dropdownMenuLink') .click(); @@ -27,5 +33,23 @@ describe('Find owned movies', function () { cy.get('[data-key="2"]') .click(); + + cy.get('label > input') + .clear() + .type('101 Dalmatians'); + + cy.get('.col-md-10 > .card-body > .card-title') + .should('have.text', '101 Dalmatians II Patch\'s London Adventure (2003)'); + }); + + it('Regular Movies Empty', () => { + cy.get('#dropdownMenuLink') + .click(); + + cy.get('[data-key="1"]') + .click(); + + cy.get('.card-body > .btn') + .should('be.visible'); }); }); diff --git a/package.json b/package.json index 66d182e..f3d9f07 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "/", "dependencies": {}, "devDependencies": { - "cypress": "^4.0.0" + "cypress": "^4.0.1" }, "scripts": { "e2e": "cypress open"