From dec3dfa3cf13da1e239644e870383e3c1cfcf050 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 10 Nov 2016 13:37:55 +0100 Subject: [PATCH] feat(Utils): add tests for `getExtension` --- tests/ui/scripts/Utils/utils.spec.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/ui/scripts/Utils/utils.spec.qml b/tests/ui/scripts/Utils/utils.spec.qml index a68575a2c..bec022310 100644 --- a/tests/ui/scripts/Utils/utils.spec.qml +++ b/tests/ui/scripts/Utils/utils.spec.qml @@ -181,6 +181,21 @@ TestCase { // ----------------------------------------------------------------- + function test_getExtension_data () { + return [ + { input: 'foobar.baz', output: 'baz' }, + { input: 'classe.george.abitbol', output: 'abitbol' }, + { input: '', output: '' }, + { input: 'cotcotcot', output: '' } + ] + } + + function test_getExtension (data) { + compare(Utils.getExtension(data.input), data.output) + } + + // ----------------------------------------------------------------- + function test_includes_data () { return [ // Test arrays.