mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
Fixed up tests to be aware of the new dialog
This commit is contained in:
parent
5e6edc2ad8
commit
5678f43f41
6 changed files with 168 additions and 38 deletions
|
@ -1,5 +1,6 @@
|
|||
import { BasePage } from "../base.page";
|
||||
import { DiscoverCard } from "../shared/DiscoverCard";
|
||||
import { AdminRequestDialog } from "../shared/AdminRequestDialog";
|
||||
import { DiscoverCard, DiscoverType } from "../shared/DiscoverCard";
|
||||
|
||||
class CarouselComponent {
|
||||
private type: string;
|
||||
|
@ -16,8 +17,8 @@ class CarouselComponent {
|
|||
return cy.get(`#${this.type}Tv-button`);
|
||||
}
|
||||
|
||||
getCard(id: string, movie: boolean): DiscoverCard {
|
||||
return new DiscoverCard(id, movie);
|
||||
getCard(id: string, movie: boolean, type?: DiscoverType): DiscoverCard {
|
||||
return new DiscoverCard(id, movie, type);
|
||||
}
|
||||
|
||||
constructor(id: string) {
|
||||
|
@ -27,6 +28,7 @@ class CarouselComponent {
|
|||
|
||||
class DiscoverPage extends BasePage {
|
||||
popularCarousel = new CarouselComponent("popular");
|
||||
adminOptionsDialog = new AdminRequestDialog();
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
|
|
@ -1,13 +1,22 @@
|
|||
import { EpisodeRequestModal } from "./EpisodeRequestModal";
|
||||
|
||||
export enum DiscoverType {
|
||||
Upcoming,
|
||||
Trending,
|
||||
Popular,
|
||||
RecentlyRequested,
|
||||
}
|
||||
|
||||
export class DiscoverCard {
|
||||
private id: string;
|
||||
private movie: boolean;
|
||||
private type: DiscoverType;
|
||||
|
||||
episodeRequestModal = new EpisodeRequestModal();
|
||||
constructor(id: string, movie: boolean) {
|
||||
constructor(id: string, movie: boolean, type?: DiscoverType) {
|
||||
this.id = id;
|
||||
this.movie = movie;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
get topLevelCard(): Cypress.Chainable<any> {
|
||||
|
@ -35,7 +44,7 @@ export class DiscoverCard {
|
|||
}
|
||||
|
||||
get requestButton(): Cypress.Chainable<any> {
|
||||
return cy.get(`#requestButton${this.id}${this.movie ? '1' : '0'}`);
|
||||
return cy.get(`#requestButton${this.id}${this.movie ? '1' : '0'}${this.type}`);
|
||||
}
|
||||
|
||||
verifyTitle(expected: string): Cypress.Chainable<any> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue