From ac24c379739040d7e687d030c5479814dd7dfa5f Mon Sep 17 00:00:00 2001 From: TOomaAh Date: Tue, 6 May 2025 13:45:28 +0200 Subject: [PATCH] fix(test): fix test with default provider tmdb anime --- cypress/e2e/providers/tvdb.cy.ts | 22 ++++++++++++++++++++++ server/lib/settings/index.ts | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/providers/tvdb.cy.ts b/cypress/e2e/providers/tvdb.cy.ts index 8f8f32c5..c5242a74 100644 --- a/cypress/e2e/providers/tvdb.cy.ts +++ b/cypress/e2e/providers/tvdb.cy.ts @@ -5,6 +5,7 @@ describe('TVDB Integration', () => { metadataSettings: '/settings/metadata', tomorrowIsOursTvShow: '/tv/72879', monsterTvShow: '/tv/225634', + dragonnBallZKayAnime: '/tv/61709', }; const SELECTORS = { @@ -20,6 +21,7 @@ describe('TVDB Integration', () => { seasonSelector: '[data-testid="season-selector"]', season1: 'Season 1', season2: 'Season 2', + season3: 'Season 3', episodeList: '[data-testid="episode-list"]', episode9: '9 - Hang Men', }; @@ -71,6 +73,9 @@ describe('TVDB Integration', () => { // Supposons que vous avez ajouté data-testid au div parent du Select cy.get('[data-testid="tv-indexer-selector"]').click(); + // get id react-select-4-option-1 + cy.get('[id^="react-select-4-option-"]').contains('TheTVDB').click(); + // Test the connection testAndVerifyMetadataConnection().then(({ response }) => { expect(response.statusCode).to.equal(200); @@ -124,4 +129,21 @@ describe('TVDB Integration', () => { // Verify specific episode exists cy.contains(SELECTORS.episode9).should('be.visible'); }); + + it('should display "Dragon Ball Z Kai" show information with multiple only 2 seasons from TVDB', () => { + // Navigate to the TV show + cy.visit(ROUTES.dragonnBallZKayAnime); + + // Intercept season 1 request + cy.intercept('/api/v1/tv/61709/season/1').as('season1'); + + // Select Season 2 and verify it visible + cy.contains(SELECTORS.season2) + .should('be.visible') + .scrollIntoView() + .click(); + + // select season 3 and verify it not visible + cy.contains(SELECTORS.season3).should('not.exist'); + }); }); diff --git a/server/lib/settings/index.ts b/server/lib/settings/index.ts index fbc19041..215f0e51 100644 --- a/server/lib/settings/index.ts +++ b/server/lib/settings/index.ts @@ -423,7 +423,7 @@ class Settings { tautulli: {}, metadataSettings: { tv: IndexerType.TMDB, - anime: IndexerType.TVDB, + anime: IndexerType.TMDB, }, radarr: [], sonarr: [],