Merge pull request #171 from Stremio/video-selected-season

last season selected in videos list
This commit is contained in:
Nikola Hristov 2020-04-28 16:54:54 +03:00 committed by GitHub
commit 93d6f67eec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ const reducer = (state, action) => {
state.selectedSeason
:
seasons.length > 0 ?
seasons[0]
seasons[seasons.length - 1]
:
null;
return {

View file

@ -7,10 +7,10 @@ const videos = [{ 'season': 4 }, { 'season': 5 }, { 'season': 4 }, { 'season': 7
describe('hooks tests', () => {
describe('useSelectableSeasons hook', () => {
it('match 4', async () => {
it('match 7', async () => {
const { result } = renderHook(() => useSelectableSeasons(videos));
const [, selectedSeason] = result.current;
expect(selectedSeason).toBe(4);
expect(selectedSeason).toBe(7);
});
it('match 5', async () => {