Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: view other users' watchlists (#2959)
* feat: view other users' watchlists * test: add cypress tests * feat(lang): translation keys * refactor: yarn format * fix: manage requests perm is parent of view watchlist perm
- Loading branch information
1 parent
950b171
commit 0839718
Showing
17 changed files
with
347 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
describe('User Profile', () => { | ||
beforeEach(() => { | ||
cy.login(Cypress.env('ADMIN_EMAIL'), Cypress.env('ADMIN_PASSWORD')); | ||
}); | ||
|
||
it('opens user profile page from the home page', () => { | ||
cy.visit('/'); | ||
|
||
cy.get('[data-testid=user-menu]').click(); | ||
cy.get('[data-testid=user-menu-profile]').click(); | ||
|
||
cy.get('h1').should('contain', Cypress.env('ADMIN_EMAIL')); | ||
}); | ||
|
||
it('loads plex watchlist', () => { | ||
cy.intercept('/api/v1/user/[0-9]*/watchlist', { | ||
fixture: 'watchlist.json', | ||
}).as('getWatchlist'); | ||
// Wait for one of the watchlist movies to resolve | ||
cy.intercept('/api/v1/movie/361743').as('getTmdbMovie'); | ||
|
||
cy.visit('/profile'); | ||
|
||
cy.wait('@getWatchlist'); | ||
|
||
const sliderHeader = cy.contains('.slider-header', 'Plex Watchlist'); | ||
|
||
sliderHeader.scrollIntoView(); | ||
|
||
cy.wait('@getTmdbMovie'); | ||
// Wait a little longer to make sure the movie component reloaded | ||
cy.wait(500); | ||
|
||
sliderHeader | ||
.next('[data-testid=media-slider]') | ||
.find('[data-testid=title-card]') | ||
.first() | ||
.trigger('mouseover') | ||
.find('[data-testid=title-card-title]') | ||
.invoke('text') | ||
.then((text) => { | ||
cy.contains('.slider-header', 'Plex Watchlist') | ||
.next('[data-testid=media-slider]') | ||
.find('[data-testid=title-card]') | ||
.first() | ||
.click(); | ||
cy.get('[data-testid=media-title]').should('contain', text); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.