From 25b6f12fbf54547c89feaf79ed9f3fba32ab3b69 Mon Sep 17 00:00:00 2001 From: alexesprit Date: Sat, 21 Nov 2020 11:55:07 +0300 Subject: [PATCH] Update tests for `fixTrackSuffix` function Remove redundand test cases. Update case description. --- test/function/fix-track-suffix.spec.ts | 84 +++++++------------------- 1 file changed, 22 insertions(+), 62 deletions(-) diff --git a/test/function/fix-track-suffix.spec.ts b/test/function/fix-track-suffix.spec.ts index 8e9b8de..9692816 100644 --- a/test/function/fix-track-suffix.spec.ts +++ b/test/function/fix-track-suffix.spec.ts @@ -14,88 +14,48 @@ testFilterFunction(fixTrackSuffix, [ expectedValue: 'Track Title (Remix)', }, { - description: 'should replace invalid suffix', + description: 'should replace invalid "Remix" suffix', funcParameter: 'Track Title - Artist Remix', expectedValue: 'Track Title (Artist Remix)', }, { - description: 'should replace invalid suffix', + description: 'should replace invalid "X Remix" suffix', funcParameter: 'Track Title - Remix', expectedValue: 'Track Title (Remix)', }, { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Remix', - expectedValue: 'Track A (Remix)', + description: 'should replace invalid "X Dub" suffix', + funcParameter: 'Track Title - Group X dub', + expectedValue: 'Track Title (Group X dub)', }, { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Group X dub', - expectedValue: 'Track A (Group X dub)', + description: 'should replace invalid "X Edit" suffix', + funcParameter: 'Track Title - Group X edit', + expectedValue: 'Track Title (Group X edit)', }, { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Group X edit', - expectedValue: 'Track A (Group X edit)', + description: 'should replace invalid "X Mix" suffix', + funcParameter: 'Track Title - Group X mix', + expectedValue: 'Track Title (Group X mix)', }, { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Group X mix', - expectedValue: 'Track A (Group X mix)', + description: 'should replace invalid multifle suffixes', + funcParameter: 'Track Title - Group X Remix Edit', + expectedValue: 'Track Title (Group X Remix Edit)', }, { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Group X Remix Edit', - expectedValue: 'Track A (Group X Remix Edit)', + description: 'should replace invalid "VIP" suffix', + funcParameter: 'Track Title - VIP', + expectedValue: 'Track Title (VIP)', }, { - description: 'should replace invalid suffix', - funcParameter: 'Track A - VIP', - expectedValue: 'Track A (VIP)', - }, - { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Radio Edit', - expectedValue: 'Track A (Radio Edit)', - }, - { - description: 'should replace invalid suffix', - funcParameter: 'Track A - X Radio Edit', - expectedValue: 'Track A (X Radio Edit)', - }, - { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Short Version', - expectedValue: 'Track A (Short Version)', - }, - { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Original Mix', - expectedValue: 'Track A (Original Mix)', - }, - { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Radio Version', - expectedValue: 'Track A (Radio Version)', - }, - { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Group X Radio Mix', - expectedValue: 'Track A (Group X Radio Mix)', - }, - { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Continuous Mix', - expectedValue: 'Track A (Continuous Mix)', - }, - { - description: 'should replace invalid suffix', - funcParameter: 'Track A - Factoria Vocal Mix', - expectedValue: 'Track A (Factoria Vocal Mix)', + description: 'should replace invalid "X Version" suffix', + funcParameter: 'Track Title - Short Version', + expectedValue: 'Track Title (Short Version)', }, { description: 'should remove "- Original" sufix', - funcParameter: 'Track A - Original', - expectedValue: 'Track A ', + funcParameter: 'Track Title - Original', + expectedValue: 'Track Title ', }, ]);