Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar committed Mar 11, 2021
1 parent 0a804c6 commit bf2e5b4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Expand Up @@ -21,7 +21,7 @@
</div>
<div class="row button-request-container" *ngIf="!result.available && !result.approved && !result.requested">
<div class="button-request poster-overlay">
<button attr.data-test="requestButton{{result.id}}{{result.type}}" mat-raised-button class="btn-green full-width poster-request-btn" (click)="request($event)">
<button id="requestButton{{result.id}}{{result.type}}" mat-raised-button class="btn-green full-width poster-request-btn" (click)="request($event)">
<mat-icon *ngIf="!loading">cloud_download</mat-icon>
<i *ngIf="loading" class="fas fa-spinner fa-pulse fa-2x fa-fw" aria-hidden="true"></i>
</button>
Expand Down
Expand Up @@ -33,7 +33,7 @@ class DiscoverCard {
}

get requestButton(): Cypress.Chainable<any> {
return cy.get(`button > [data-test=requestButton${this.id}${this.movie ? '1' : '0'}]`);
return cy.get(`#requestButton${this.id}${this.movie ? '1' : '0'}`);
}

verifyTitle(expected: string): Cypress.Chainable<any> {
Expand Down
8 changes: 4 additions & 4 deletions tests/cypress/support/commands.ts
Expand Up @@ -105,17 +105,17 @@ Cypress.Commands.add("getByData", (selector) => {

fireEvent(elements, 'mouseover');


function fireEvent(element, event) {
if (element.fireEvent) {
element.fireEvent('on' + event);
} else {
var evObj = document.createEvent('Events');

evObj.initEvent(event, true, false);

element.dispatchEvent(evObj);
}
}

});
8 changes: 4 additions & 4 deletions tests/cypress/tests/discover/discover-cards.spec.ts
Expand Up @@ -65,7 +65,7 @@ describe("Discover Cards Tests", () => {
cy.wait("@tvPopular");
});

it.skip("Not requested movie allows us to request", () => {
it("Not requested movie allows us to request", () => {
window.localStorage.setItem("DiscoverOptions2", "2");
cy.intercept("GET", "**/search/Movie/Popular/**", (req) => {
req.reply((res) => {
Expand Down Expand Up @@ -106,7 +106,7 @@ describe("Discover Cards Tests", () => {
});
});

it.skip("Available movie does not allow us to request", () => {
it("Available movie does not allow us to request", () => {
window.localStorage.setItem("DiscoverOptions2", "2");
cy.intercept("GET", "**/search/Movie/Popular/**", (req) => {
req.reply((res) => {
Expand Down Expand Up @@ -138,7 +138,7 @@ describe("Discover Cards Tests", () => {
});
});

it.skip("Requested movie does not allow us to request", () => {
it("Requested movie does not allow us to request", () => {
window.localStorage.setItem("DiscoverOptions2", "2");
cy.intercept("GET", "**/search/Movie/Popular/**", (req) => {
req.reply((res) => {
Expand Down Expand Up @@ -170,7 +170,7 @@ describe("Discover Cards Tests", () => {
card.statusClass.should('have.class','requested');
});

it.skip("Approved movie does not allow us to request", () => {
it("Approved movie does not allow us to request", () => {
window.localStorage.setItem("DiscoverOptions2", "2");
cy.intercept("GET", "**/search/Movie/Popular/**", (req) => {
req.reply((res) => {
Expand Down

0 comments on commit bf2e5b4

Please sign in to comment.