fixed tests

pull/4099/head
tidusjar 4 years ago
parent 0a804c6233
commit bf2e5b4e4f

@ -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>

@ -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> {

@ -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);
}
}
});

@ -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) => {
@ -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) => {
@ -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) => {
@ -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) => {

Loading…
Cancel
Save