Commit 74af0bfe authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '33110-gitlab-foss-master-broken-karma-issue-card-component' into 'master'

Resolve "gitlab-foss master broken Karma: Issue card component"

Closes #33110

See merge request gitlab-org/gitlab!17916
parents a67dc987 578810fe
......@@ -104,13 +104,6 @@ export default {
helpLink() {
return boardsStore.scopedLabels.helpLink;
},
validIssueWeight() {
if (_.isNumber(this.issue.weight)) {
return this.issue.weight >= 0;
}
return false;
},
},
methods: {
isIndexLessThanlimit(index) {
......
export default {
computed: {
validIssueWeight() {
return false;
},
},
methods: {
filterByWeight() {},
},
......
import _ from 'underscore';
export default {
computed: {
validIssueWeight() {
if (this.issue && _.isNumber(this.issue.weight)) {
return this.issue.weight >= 0;
}
return false;
},
},
methods: {
filterByWeight(weight) {
if (!this.updateFilters) return;
......
......@@ -39,4 +39,21 @@ describe('IssueCardWeight component', () => {
expect(vm.$el.querySelector('span.board-card-info')).toBeDefined();
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', () => {
.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