diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-06-06 22:57:07 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-06-06 22:57:07 +0300 |
commit | d1c2d36f0325c79aed9b5ae2e6396591c6ced3be (patch) | |
tree | 10c0fb25aa9c4d2862ff995860304d4a7417e53c /spec/javascripts | |
parent | 1d5d2a10a3068b2a7f5e46ef47cf1e7ec190f1d1 (diff) | |
parent | 78f131c0514bc99f73b9c063fac3158ab2e51e17 (diff) |
Merge branch 'fix_commits_page' into 'master'
Fix duplication of commits header on commits page
Closes #13879
See merge request !11006
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/commits_spec.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/javascripts/commits_spec.js b/spec/javascripts/commits_spec.js index 187db7485a5..44a4386b250 100644 --- a/spec/javascripts/commits_spec.js +++ b/spec/javascripts/commits_spec.js @@ -28,6 +28,32 @@ import '~/commits'; expect(CommitsList).toBeDefined(); }); + describe('processCommits', () => { + it('should join commit headers', () => { + CommitsList.$contentList = $(` + <div> + <li class="commit-header" data-day="2016-09-20"> + <span class="day">20 Sep, 2016</span> + <span class="commits-count">1 commit</span> + </li> + <li class="commit"></li> + </div> + `); + + const data = ` + <li class="commit-header" data-day="2016-09-20"> + <span class="day">20 Sep, 2016</span> + <span class="commits-count">1 commit</span> + </li> + <li class="commit"></li> + `; + + // The last commit header should be removed + // since the previous one has the same data-day value. + expect(CommitsList.processCommits(data).find('li.commit-header').length).toBe(0); + }); + }); + describe('on entering input', () => { let ajaxSpy; |