summaryrefslogtreecommitdiff
path: root/spec/frontend/lib/utils/text_utility_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/lib/utils/text_utility_spec.js')
-rw-r--r--spec/frontend/lib/utils/text_utility_spec.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/text_utility_spec.js b/spec/frontend/lib/utils/text_utility_spec.js
index dc8f6c64136..4969c591dcd 100644
--- a/spec/frontend/lib/utils/text_utility_spec.js
+++ b/spec/frontend/lib/utils/text_utility_spec.js
@@ -224,4 +224,18 @@ describe('text_utility', () => {
});
});
});
+
+ describe('hasContent', () => {
+ it.each`
+ txt | result
+ ${null} | ${false}
+ ${undefined} | ${false}
+ ${{ an: 'object' }} | ${false}
+ ${''} | ${false}
+ ${' \t\r\n'} | ${false}
+ ${'hello'} | ${true}
+ `('returns $result for input $txt', ({ result, txt }) => {
+ expect(textUtils.hasContent(txt)).toEqual(result);
+ });
+ });
});