mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-14 21:26:15 -08:00
test(playlist): cover disabled auto-refresh preservation
This commit is contained in:
1 parent
a5ea92682b
commit
bfcc0c9929
1 file changed
+34
@@ -164,4 +164,38 @@ describe('playlistReducers', () => {
|
||||
nextState.playlists.entities['playlist-1']?.autoRefresh
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('keeps autoRefresh disabled on playlist refresh when the existing playlist has it disabled', () => {
|
||||
const existingPlaylist: PlaylistMeta = {
|
||||
_id: 'playlist-1',
|
||||
autoRefresh: false,
|
||||
count: 1,
|
||||
importDate: '2026-03-28T00:00:00.000Z',
|
||||
title: 'Playlist One',
|
||||
} as PlaylistMeta;
|
||||
const state = {
|
||||
...initialState,
|
||||
playlists: playlistsAdapter.addOne(existingPlaylist, {
|
||||
...initialState.playlists,
|
||||
selectedId: 'playlist-1',
|
||||
}),
|
||||
};
|
||||
|
||||
const nextState = reducer(
|
||||
state,
|
||||
PlaylistActions.updatePlaylist({
|
||||
playlist: {
|
||||
autoRefresh: true,
|
||||
playlist: {
|
||||
items: [],
|
||||
},
|
||||
} as Playlist,
|
||||
playlistId: 'playlist-1',
|
||||
})
|
||||
);
|
||||
|
||||
expect(
|
||||
nextState.playlists.entities['playlist-1']?.autoRefresh
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user