mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 22:18:29 +08:00
FIX: emoji-picker broken and skipped specs
This commit is contained in:
parent
c7c93e7159
commit
22c5fb20b4
|
@ -71,13 +71,7 @@ export default Ember.Component.extend({
|
||||||
$.each($results.find(".emoji.diversity"), (_, button) => this._setButtonBackground(button, true) );
|
$.each($results.find(".emoji.diversity"), (_, button) => this._setButtonBackground(button, true) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$picker
|
this._updateSelectedDiversity();
|
||||||
.find(".diversity-picker .diversity-scale")
|
|
||||||
.removeClass("selected");
|
|
||||||
|
|
||||||
$picker
|
|
||||||
.find(`.diversity-picker .diversity-scale[data-level="${this.get("selectedDiversity")}"]`)
|
|
||||||
.addClass("selected");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@observes("recentEmojis")
|
@observes("recentEmojis")
|
||||||
|
@ -141,9 +135,19 @@ export default Ember.Component.extend({
|
||||||
this._loadCategoriesEmojis();
|
this._loadCategoriesEmojis();
|
||||||
this._positionPicker();
|
this._positionPicker();
|
||||||
this._scrollTo();
|
this._scrollTo();
|
||||||
|
this._updateSelectedDiversity();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_updateSelectedDiversity() {
|
||||||
|
const $diversityPicker = $picker.find(".diversity-picker");
|
||||||
|
|
||||||
|
$diversityPicker.find(".diversity-scale").removeClass("selected");
|
||||||
|
$diversityPicker
|
||||||
|
.find(`.diversity-scale[data-level="${this.get("selectedDiversity")}"]`)
|
||||||
|
.addClass("selected");
|
||||||
|
},
|
||||||
|
|
||||||
_sectionLoadingCheck() {
|
_sectionLoadingCheck() {
|
||||||
_checkTimeout = setTimeout(() => { this._sectionLoadingCheck(); }, 500);
|
_checkTimeout = setTimeout(() => { this._sectionLoadingCheck(); }, 500);
|
||||||
Ember.run.throttle(this, this._checkVisibleSection, 100);
|
Ember.run.throttle(this, this._checkVisibleSection, 100);
|
||||||
|
|
|
@ -47,22 +47,7 @@ QUnit.test("emojis can be hovered to display info", assert => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.skip("emoji picker has sections", assert => {
|
QUnit.test("emoji picker triggers event when picking emoji", assert => {
|
||||||
visit("/t/internationalization-localization/280");
|
|
||||||
click("#topic-footer-buttons .btn.create");
|
|
||||||
click("button.emoji.btn");
|
|
||||||
|
|
||||||
click(".emoji-picker .categories-column button[title='travel']");
|
|
||||||
andThen(() => {
|
|
||||||
assert.notEqual(
|
|
||||||
find('.emoji-picker .list').scrollTop(),
|
|
||||||
0,
|
|
||||||
"it scrolls to section"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
QUnit.skip("emoji picker triggers event when picking emoji", assert => {
|
|
||||||
visit("/t/internationalization-localization/280");
|
visit("/t/internationalization-localization/280");
|
||||||
click("#topic-footer-buttons .btn.create");
|
click("#topic-footer-buttons .btn.create");
|
||||||
click("button.emoji.btn");
|
click("button.emoji.btn");
|
||||||
|
@ -82,7 +67,6 @@ QUnit.test("emoji picker has a list of recently used emojis", assert => {
|
||||||
click("#topic-footer-buttons .btn.create");
|
click("#topic-footer-buttons .btn.create");
|
||||||
click("button.emoji.btn");
|
click("button.emoji.btn");
|
||||||
|
|
||||||
click(".emoji-picker .clear-recent");
|
|
||||||
click(".emoji-picker .section[data-section='people'] button.emoji[title='grinning']");
|
click(".emoji-picker .section[data-section='people'] button.emoji[title='grinning']");
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
|
@ -120,13 +104,12 @@ QUnit.test("emoji picker has a list of recently used emojis", assert => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.skip("emoji picker correctly orders recently used emojis", assert => {
|
QUnit.test("emoji picker correctly orders recently used emojis", assert => {
|
||||||
visit("/t/internationalization-localization/280");
|
visit("/t/internationalization-localization/280");
|
||||||
click("#topic-footer-buttons .btn.create");
|
click("#topic-footer-buttons .btn.create");
|
||||||
click("button.emoji.btn");
|
|
||||||
click(".emoji-picker .clear-recent");
|
|
||||||
|
|
||||||
click(".emoji-picker button[title='grinning']");
|
click("button.emoji.btn");
|
||||||
|
andThen(() => {
|
||||||
click(".emoji-picker button[title='sunglasses']");
|
click(".emoji-picker button[title='sunglasses']");
|
||||||
click(".emoji-picker button[title='grinning']");
|
click(".emoji-picker button[title='grinning']");
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
|
@ -137,31 +120,31 @@ QUnit.skip("emoji picker correctly orders recently used emojis", assert => {
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find('.section[data-section="recent"] .section-group button.emoji').first().attr('src'),
|
/grinning/.test(find('.section[data-section="recent"] .section-group button.emoji').first().css('background-image')),
|
||||||
`/images/emoji/emoji_one/grinning.png?v=${v}`,
|
true,
|
||||||
"it puts the last used emoji in first"
|
"it puts the last used emoji in first"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.skip("emoji picker lazy loads emojis", assert => {
|
QUnit.test("emoji picker lazy loads emojis", assert => {
|
||||||
visit("/t/internationalization-localization/280");
|
visit("/t/internationalization-localization/280");
|
||||||
click("#topic-footer-buttons .btn.create");
|
click("#topic-footer-buttons .btn.create");
|
||||||
|
|
||||||
click("button.emoji.btn");
|
click("button.emoji.btn");
|
||||||
|
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
const $emoji = $('.emoji-picker button[title="massage_woman"] img');
|
|
||||||
assert.equal(
|
assert.equal(
|
||||||
$emoji.attr('src'),
|
find('.emoji-picker button[title="massage_woman"]').css("background-image"),
|
||||||
"",
|
"none",
|
||||||
"it doesn't load invisible emojis"
|
"it doesn't load invisible emojis"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
QUnit.skip("emoji picker persists state", assert => {
|
QUnit.test("emoji picker persists state", assert => {
|
||||||
visit("/t/internationalization-localization/280");
|
visit("/t/internationalization-localization/280");
|
||||||
click("#topic-footer-buttons .btn.create");
|
click("#topic-footer-buttons .btn.create");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user