diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-08-05 19:38:05 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-08-05 19:38:05 +0000 |
commit | d4f06e4907b5154fa864634eb67cb74427a31dd6 (patch) | |
tree | 23e35acb8c5198edd4d299eedeed8205b4152503 | |
parent | 59565719bc4d9cf9aa5fc3396ae941daa1a80d59 (diff) | |
parent | 7450248bae4327fdff2cd62e1c47180dbe23311f (diff) | |
download | gitlab-ce-d4f06e4907b5154fa864634eb67cb74427a31dd6.tar.gz |
Merge branch 'date-time-to-day-tests' into 'master'
Added tests to dateTime utility getDayName method
## What does this MR do?
It was missing tests so i've created some tests to check the correct day name is returned
See merge request !5324
-rw-r--r-- | spec/javascripts/datetime_utility_spec.js.coffee | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/javascripts/datetime_utility_spec.js.coffee b/spec/javascripts/datetime_utility_spec.js.coffee new file mode 100644 index 00000000000..6b9617341fe --- /dev/null +++ b/spec/javascripts/datetime_utility_spec.js.coffee @@ -0,0 +1,31 @@ +#= require lib/utils/datetime_utility + +describe 'Date time utils', -> + describe 'get day name', -> + it 'should return Sunday', -> + day = gl.utils.getDayName(new Date('07/17/2016')) + expect(day).toBe('Sunday') + + it 'should return Monday', -> + day = gl.utils.getDayName(new Date('07/18/2016')) + expect(day).toBe('Monday') + + it 'should return Tuesday', -> + day = gl.utils.getDayName(new Date('07/19/2016')) + expect(day).toBe('Tuesday') + + it 'should return Wednesday', -> + day = gl.utils.getDayName(new Date('07/20/2016')) + expect(day).toBe('Wednesday') + + it 'should return Thursday', -> + day = gl.utils.getDayName(new Date('07/21/2016')) + expect(day).toBe('Thursday') + + it 'should return Friday', -> + day = gl.utils.getDayName(new Date('07/22/2016')) + expect(day).toBe('Friday') + + it 'should return Saturday', -> + day = gl.utils.getDayName(new Date('07/23/2016')) + expect(day).toBe('Saturday') |