Merge branch 'awards_handler-fixture' into 'master'
Replace static fixture for awards_handler_spec ## What does this MR do? Use the already existing dynamic fixture `issues/open-issue.html` (!6059) in `awards_handler_spec.js` instead of the static fixture `awards_handler.html.haml`. ## What are the relevant issue numbers? #24753 See merge request !7661
This commit is contained in:
commit
d8d07976ec
3 changed files with 9 additions and 57 deletions
4
changelogs/unreleased/awards_handler.yml
Normal file
4
changelogs/unreleased/awards_handler.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Replace static fixture for awards_handler_spec
|
||||||
|
merge_request: 7661
|
||||||
|
author: winniehell
|
|
@ -33,9 +33,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('AwardsHandler', function() {
|
describe('AwardsHandler', function() {
|
||||||
fixture.preload('awards_handler.html');
|
fixture.preload('issues/open-issue.html.raw');
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
fixture.load('awards_handler.html');
|
fixture.load('issues/open-issue.html.raw');
|
||||||
awardsHandler = new AwardsHandler;
|
awardsHandler = new AwardsHandler;
|
||||||
spyOn(awardsHandler, 'postEmoji').and.callFake((function(_this) {
|
spyOn(awardsHandler, 'postEmoji').and.callFake((function(_this) {
|
||||||
return function(url, emoji, cb) {
|
return function(url, emoji, cb) {
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
});
|
});
|
||||||
describe('::getAwardUrl', function() {
|
describe('::getAwardUrl', function() {
|
||||||
return it('should return the url for request', function() {
|
return it('should return the url for request', function() {
|
||||||
return expect(awardsHandler.getAwardUrl()).toBe('/gitlab-org/gitlab-test/issues/8/toggle_award_emoji');
|
return expect(awardsHandler.getAwardUrl()).toBe('http://test.host/frontend-fixtures/issues-project/issues/1/toggle_award_emoji');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('::addAward and ::checkMutuality', function() {
|
describe('::addAward and ::checkMutuality', function() {
|
||||||
|
@ -209,7 +209,7 @@
|
||||||
$('.js-add-award').eq(0).click();
|
$('.js-add-award').eq(0).click();
|
||||||
$menu = $('.emoji-menu');
|
$menu = $('.emoji-menu');
|
||||||
$block = $('.js-awards-block');
|
$block = $('.js-awards-block');
|
||||||
$emoji = $menu.find(".emoji-menu-list-item " + selector);
|
$emoji = $menu.find('.emoji-menu-list:not(.frequent-emojis) ' + selector);
|
||||||
expect($emoji.length).toBe(1);
|
expect($emoji.length).toBe(1);
|
||||||
expect($block.find(selector).length).toBe(0);
|
expect($block.find(selector).length).toBe(0);
|
||||||
$emoji.click();
|
$emoji.click();
|
||||||
|
@ -224,7 +224,7 @@
|
||||||
openEmojiMenuAndAddEmoji();
|
openEmojiMenuAndAddEmoji();
|
||||||
$('.js-add-award').eq(0).click();
|
$('.js-add-award').eq(0).click();
|
||||||
$block = $('.js-awards-block');
|
$block = $('.js-awards-block');
|
||||||
$emoji = $('.emoji-menu').find(".emoji-menu-list-item " + selector);
|
$emoji = $('.emoji-menu').find(".emoji-menu-list:not(.frequent-emojis) " + selector);
|
||||||
$emoji.click();
|
$emoji.click();
|
||||||
return expect($block.find(selector).length).toBe(0);
|
return expect($block.find(selector).length).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
.issue-details.issuable-details
|
|
||||||
.detail-page-description.content-block
|
|
||||||
%h2.title Quibusdam sint officiis earum molestiae ipsa autem voluptatem nisi rem.
|
|
||||||
.description.js-task-list-container.is-task-list-enabled
|
|
||||||
.wiki
|
|
||||||
%p Qui exercitationem magnam optio quae fuga earum odio.
|
|
||||||
%textarea.hidden.js-task-list-field Qui exercitationem magnam optio quae fuga earum odio.
|
|
||||||
%small.edited-text
|
|
||||||
.content-block.content-block-small
|
|
||||||
.awards.js-awards-block{"data-award-url" => "/gitlab-org/gitlab-test/issues/8/toggle_award_emoji"}
|
|
||||||
%button.award-control.btn.js-emoji-btn{"data-placement" => "bottom", "data-title" => "", :type => "button"}
|
|
||||||
.icon.emoji-icon.emoji-1F44D{"data-aliases" => "", "data-emoji" => "thumbsup", "data-unicode-name" => "1F44D", :title => "thumbsup"}
|
|
||||||
%span.award-control-text.js-counter 0
|
|
||||||
%button.award-control.btn.js-emoji-btn{"data-placement" => "bottom", "data-title" => "", :type => "button"}
|
|
||||||
.icon.emoji-icon.emoji-1F44E{"data-aliases" => "", "data-emoji" => "thumbsdown", "data-unicode-name" => "1F44E", :title => "thumbsdown"}
|
|
||||||
%span.award-control-text.js-counter 0
|
|
||||||
.award-menu-holder.js-award-holder
|
|
||||||
%button.btn.award-control.js-add-award{:type => "button"}
|
|
||||||
%i.fa.fa-smile-o.award-control-icon.award-control-icon-normal
|
|
||||||
%i.fa.fa-spinner.fa-spin.award-control-icon.award-control-icon-loading
|
|
||||||
%span.award-control-text Add
|
|
||||||
%section.issuable-discussion
|
|
||||||
#notes
|
|
||||||
%ul#notes-list.notes.main-notes-list.timeline
|
|
||||||
%li#note_348.note.note-row-348.timeline-entry{"data-author-id" => "18", "data-editable" => ""}
|
|
||||||
.timeline-entry-inner
|
|
||||||
.timeline-icon
|
|
||||||
%a{:href => "/u/agustin"}
|
|
||||||
%img.avatar.s40{:alt => "", :src => "#"}/
|
|
||||||
.timeline-content
|
|
||||||
.note-header
|
|
||||||
%a.author_link{:href => "/u/agustin"}
|
|
||||||
%span.author Brenna Stokes
|
|
||||||
.inline.note-headline-light
|
|
||||||
@agustin commented
|
|
||||||
%a{:href => "#note_348"}
|
|
||||||
%time 11 days ago
|
|
||||||
.note-actions
|
|
||||||
%span.note-role Reporter
|
|
||||||
%a.note-action-button.note-emoji-button.js-add-award.js-note-emoji{"data-position" => "right", :href => "#", :title => "Award Emoji"}
|
|
||||||
%i.fa.fa-spinner.fa-spin
|
|
||||||
%i.fa.fa-smile-o.link-highlight
|
|
||||||
.js-task-list-container.note-body.is-task-list-enabled
|
|
||||||
.note-text
|
|
||||||
%p Suscipit sunt quia quisquam sed eveniet ipsam.
|
|
||||||
.note-awards
|
|
||||||
.awards.hidden.js-awards-block{"data-award-url" => "/gitlab-org/gitlab-test/notes/348/toggle_award_emoji"}
|
|
||||||
.award-menu-holder.js-award-holder
|
|
||||||
%button.btn.award-control.js-add-award{:type => "button"}
|
|
||||||
%i.fa.fa-smile-o.award-control-icon.award-control-icon-normal
|
|
||||||
%i.fa.fa-spinner.fa-spin.award-control-icon.award-control-icon-loading
|
|
||||||
%span.award-control-text Add
|
|
Loading…
Reference in a new issue