Commit 773f1d2f authored by Phil Hughes's avatar Phil Hughes Committed by Douglas Barbosa Alexandre

Fixed weird gl dropdown error... 🙈

parent b9a52cb6
/* global BoardService */
/* global Vue */
module.exports = Vue.extend({
props: {
......
......@@ -534,9 +534,13 @@
GitLabDropdown.prototype.renderItem = function(data, group, index) {
var field, fieldName, html, selected, text, url, value, rowHidden;
value = this.options.id ? this.options.id(data) : data.id;
if (!this.options.renderRow) {
value = this.options.id ? this.options.id(data) : data.id;
if (value) { value = value.toString().replace(/'/g, '\\\''); }
if (value) {
value = value.toString().replace(/'/g, '\\\'');
}
}
// Hide element
if (this.options.hideRow && this.options.hideRow(value)) {
......
/* global Vue */
/* global boardsMockInterceptor */
/* global boardObj */
/* global BoardService */
const MilestoneComp = require('~/boards/components/milestone_select');
require('~/boards/services/board_service');
......@@ -59,7 +60,7 @@ describe('Milestone select component', () => {
expect(vm.$el.querySelector('.fa-spinner')).toBeNull();
expect(vm.$el.querySelectorAll('.board-milestone-list li').length).toBe(3);
expect(
vm.$el.querySelectorAll('.board-milestone-list li')[2].textContent
vm.$el.querySelectorAll('.board-milestone-list li')[2].textContent,
).toContain('test');
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment