- await reorderVideosPlaylist({
- url: server.url,
- token: server.accessToken,
- playlistId: playlistUUID,
- elementAttrs: {
- startPosition: 1,
- insertAfterPosition: -2
- },
- expectedStatus: 400
- })
+ {
+ const params = getBase({ insertAfterPosition: -2 })
+ await reorderVideosPlaylist(params)
+ }
+
+ {
+ const params = getBase({ insertAfterPosition: 42 })
+ await reorderVideosPlaylist(params)
+ }
+ })
+
+ it('Should fail with an invalid reorder length', async function () {
+ {
+ const params = getBase({ reorderLength: 'toto' as any })
+ await reorderVideosPlaylist(params)
+ }
+
+ {
+ const params = getBase({ reorderLength: -2 })
+ await reorderVideosPlaylist(params)
+ }
+
+ {
+ const params = getBase({ reorderLength: 42 })
+ await reorderVideosPlaylist(params)
+ }
+ })
+
+ it('Succeed with the correct params', async function () {
+ const params = getBase({}, { expectedStatus: 204 })
+ await reorderVideosPlaylist(params)
+ })
+ })