diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2019-03-28 22:42:17 +0300 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2019-03-29 09:33:30 +0300 |
commit | 7a7866a54a99bb97f97c9b85ce0a59f3078c5f1f (patch) | |
tree | 3cc1385e9ac2f524c6032c2c31f26580b4e95213 /spec/javascripts/pages | |
parent | a85fd76f524802a02957ccdcca7674f618a9e069 (diff) |
Move abuse_reports_spec.js to Jest
Diffstat (limited to 'spec/javascripts/pages')
-rw-r--r-- | spec/javascripts/pages/admin/abuse_reports/abuse_reports_spec.js | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/spec/javascripts/pages/admin/abuse_reports/abuse_reports_spec.js b/spec/javascripts/pages/admin/abuse_reports/abuse_reports_spec.js deleted file mode 100644 index f7637964c60..00000000000 --- a/spec/javascripts/pages/admin/abuse_reports/abuse_reports_spec.js +++ /dev/null @@ -1,46 +0,0 @@ -import $ from 'jquery'; -import '~/lib/utils/text_utility'; -import AbuseReports from '~/pages/admin/abuse_reports/abuse_reports'; - -describe('Abuse Reports', () => { - const FIXTURE = 'abuse_reports/abuse_reports_list.html'; - const MAX_MESSAGE_LENGTH = 500; - - let $messages; - - const assertMaxLength = $message => { - expect($message.text().length).toEqual(MAX_MESSAGE_LENGTH); - }; - const findMessage = searchText => - $messages.filter((index, element) => element.innerText.indexOf(searchText) > -1).first(); - - preloadFixtures(FIXTURE); - - beforeEach(function() { - loadFixtures(FIXTURE); - this.abuseReports = new AbuseReports(); - $messages = $('.abuse-reports .message'); - }); - - it('should truncate long messages', () => { - const $longMessage = findMessage('LONG MESSAGE'); - - expect($longMessage.data('originalMessage')).toEqual(jasmine.anything()); - assertMaxLength($longMessage); - }); - - it('should not truncate short messages', () => { - const $shortMessage = findMessage('SHORT MESSAGE'); - - expect($shortMessage.data('originalMessage')).not.toEqual(jasmine.anything()); - }); - - it('should allow clicking a truncated message to expand and collapse the full message', () => { - const $longMessage = findMessage('LONG MESSAGE'); - $longMessage.click(); - - expect($longMessage.data('originalMessage').length).toEqual($longMessage.text().length); - $longMessage.click(); - assertMaxLength($longMessage); - }); -}); |