const { Playlist } = require('../src/playlist'); describe('playlist basic manipulations', () => { const p1 = new Playlist(); test('initial state', () => { expect(p1.get_current_track()).toBeNull() }) test('add new track', () => { expect(p1.push("track1")).toBeTruthy() expect(p1.get_current_track()).toEqual("track1") }) test('remove inexisting track', () => { expect(p1.delete(100)).toBeFalsy() expect(p1.get_current_track()).toEqual("track1") }) test('remove existing track', () => { expect(p1.delete(0)).toBeTruthy() expect(p1.get_current_track()).toNull() }) })