diff --git a/src/Ombi/ClientApp/src/app/app.module.ts b/src/Ombi/ClientApp/src/app/app.module.ts index 1716b5c5e..ae4122eb7 100644 --- a/src/Ombi/ClientApp/src/app/app.module.ts +++ b/src/Ombi/ClientApp/src/app/app.module.ts @@ -19,7 +19,6 @@ import { CookieService } from "ng2-cookies"; import { CustomPageComponent } from "./custompage/custompage.component"; import { DataViewModule } from "primeng/dataview"; import { DialogModule } from "primeng/dialog"; -import { FilterService } from "./discover/services/filter-service"; import { JwtModule } from "@auth0/angular-jwt"; import { LandingPageComponent } from "./landingpage/landingpage.component"; import { LandingPageService } from "./services"; @@ -222,7 +221,6 @@ export function JwtTokenGetter() { MessageService, StorageService, RequestService, - FilterService, SignalRNotificationService, { provide: APP_BASE_HREF, diff --git a/src/Ombi/ClientApp/src/app/discover/components/search-results/search-results.component.ts b/src/Ombi/ClientApp/src/app/discover/components/search-results/search-results.component.ts index 02415a970..bef8bae03 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/search-results/search-results.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/search-results/search-results.component.ts @@ -55,18 +55,17 @@ export class DiscoverSearchResultsComponent implements OnInit { public async ngOnInit() { this.isAdmin = this.authService.isAdmin(); - - if (this.advancedDataService) { - return; - } - this.loadingFlag = true; - this.filterService.onFilterChange.subscribe(async x => { if (!isEqual(this.filter, x)) { this.filter = { ...x }; await this.search(); } }); + + if (this.advancedDataService) { + return; + } + this.loadingFlag = true; } public async init() { diff --git a/src/Ombi/ClientApp/src/app/discover/services/filter-service.ts b/src/Ombi/ClientApp/src/app/discover/services/filter-service.ts index bceeb05d6..1dece0e27 100644 --- a/src/Ombi/ClientApp/src/app/discover/services/filter-service.ts +++ b/src/Ombi/ClientApp/src/app/discover/services/filter-service.ts @@ -1,7 +1,8 @@ import { EventEmitter, Injectable, Output } from "@angular/core"; + import { SearchFilter } from "../../my-nav/SearchFilter"; -@Injectable() +@Injectable({providedIn: 'root'}) export class FilterService { @Output() public onFilterChange = new EventEmitter(); diff --git a/tests/cypress/integration/page-objects/user-preferences/user-preferences.page.ts b/tests/cypress/integration/page-objects/user-preferences/user-preferences.page.ts index 83f6a8bc5..bf0c501b6 100644 --- a/tests/cypress/integration/page-objects/user-preferences/user-preferences.page.ts +++ b/tests/cypress/integration/page-objects/user-preferences/user-preferences.page.ts @@ -18,17 +18,6 @@ class ProfileTab { } } -class MobileTab { - - get qrCode(): Cypress.Chainable { - return cy.get('#qrCode'); - } - - get noQrCode(): Cypress.Chainable { - return cy.get('#noQrCode'); - } -} - class SecurityTab { get currentPassword(): Cypress.Chainable { return cy.get('#currentPassword'); @@ -62,23 +51,17 @@ class UserPreferencesPage extends BasePage { } get profileTab(): Cypress.Chainable { - return cy.get('[role="tab"]').eq(0); + return cy.get('#mat-tab-label-0-0'); } get securityTab(): Cypress.Chainable { - return cy.get('[role="tab"]').eq(1); - } - - get preferencesTab(): Cypress.Chainable { - return cy.get('[role="tab"]').eq(2); - } - - get mobileTab(): Cypress.Chainable { - return cy.get('[role="tab"]').eq(3); + cy.waitUntil(() => { + return cy.get('#mat-tab-label-0-1').should('be.visible'); + }); + return cy.get('#mat-tab-label-0-1'); } profile = new ProfileTab(); - mobile = new MobileTab(); security = new SecurityTab(); constructor() { diff --git a/tests/cypress/tests/discover/discover-cards-requests.spec.ts b/tests/cypress/tests/discover/discover-cards-requests.spec.ts index 81d86d7e7..d024225f3 100644 --- a/tests/cypress/tests/discover/discover-cards-requests.spec.ts +++ b/tests/cypress/tests/discover/discover-cards-requests.spec.ts @@ -1,5 +1,5 @@ -import { discoverPage as Page } from "@/integration/page-objects"; import { DiscoverType } from "@/integration/page-objects/shared/DiscoverCard"; +import { discoverPage as Page } from "@/integration/page-objects"; describe("Discover Cards Requests Tests", () => { beforeEach(() => { @@ -288,9 +288,15 @@ describe("Discover Cards Requests Tests", () => { var expectedId = body[3].id; var title = body[3].title; + cy.wait(3000); + const card = Page.popularCarousel.getCard(expectedId, false, DiscoverType.Popular); card.title.realHover(); + cy.waitUntil(() => { + return card.requestButton.should("be.visible"); + }); + card.verifyTitle(title); card.requestButton.should("be.visible"); card.requestButton.click(); @@ -335,9 +341,15 @@ describe("Discover Cards Requests Tests", () => { var expectedId = body[5].id; var title = body[5].title; + cy.wait(3000); + const card = Page.popularCarousel.getCard(expectedId, false, DiscoverType.Popular); card.title.realHover(); + cy.waitUntil(() => { + return card.requestButton.should("be.visible"); + }); + card.verifyTitle(title); card.requestButton.should("be.visible"); card.requestButton.click();