Commit 578810fe authored by Ezekiel Kigbo's avatar Ezekiel Kigbo Committed by Kushal Pandya

Moved IssueCardWeight test with weight=0 to ee

Issue card weights are an EE feature, this change
moves the test cases for weight=0 to the relevant
ee spec

Reinstate spec to not render weights in FOSS
parent a67dc987
...@@ -104,13 +104,6 @@ export default { ...@@ -104,13 +104,6 @@ export default {
helpLink() { helpLink() {
return boardsStore.scopedLabels.helpLink; return boardsStore.scopedLabels.helpLink;
}, },
validIssueWeight() {
if (_.isNumber(this.issue.weight)) {
return this.issue.weight >= 0;
}
return false;
},
}, },
methods: { methods: {
isIndexLessThanlimit(index) { isIndexLessThanlimit(index) {
......
export default { export default {
computed: {
validIssueWeight() {
return false;
},
},
methods: { methods: {
filterByWeight() {}, filterByWeight() {},
}, },
......
import _ from 'underscore';
export default { export default {
computed: {
validIssueWeight() {
if (this.issue && _.isNumber(this.issue.weight)) {
return this.issue.weight >= 0;
}
return false;
},
},
methods: { methods: {
filterByWeight(weight) { filterByWeight(weight) {
if (!this.updateFilters) return; if (!this.updateFilters) return;
......
...@@ -39,4 +39,21 @@ describe('IssueCardWeight component', () => { ...@@ -39,4 +39,21 @@ describe('IssueCardWeight component', () => {
expect(vm.$el.querySelector('span.board-card-info')).toBeDefined(); expect(vm.$el.querySelector('span.board-card-info')).toBeDefined();
expect(vm.$el.querySelector('a.board-card-info')).toBeNull(); expect(vm.$el.querySelector('a.board-card-info')).toBeNull();
}); });
describe('with weight=0', () => {
beforeEach(() => {
vm = mountComponent(Component, {
weight: 0,
});
});
afterEach(() => {
vm.$destroy();
});
it('renders weight', () => {
expect(vm.$el.querySelector('.board-card-info-text')).toBeDefined();
expect(vm.$el.querySelector('.board-card-info-text')).toContainText(0);
});
});
}); });
...@@ -286,19 +286,4 @@ describe('Issue card component', () => { ...@@ -286,19 +286,4 @@ describe('Issue card component', () => {
.catch(done.fail); .catch(done.fail);
}); });
}); });
describe('weights', () => {
it('shows weight component is greater than 0', () => {
expect(component.$el.querySelector('.board-card-weight')).not.toBeNull();
});
it('shows weight component when weight is 0', done => {
component.issue.weight = 0;
Vue.nextTick(() => {
expect(component.$el.querySelector('.board-card-weight')).not.toBeNull();
done();
});
});
});
}); });
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