Commit cd0d76da authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Kushal Pandya

Support 0 weight in issue sidebar

parent 7f94e28f
......@@ -13,9 +13,9 @@ export default class SidebarStore extends CESidebarStore {
this.epic = {};
}
setWeightData(data) {
setWeightData({ weight }) {
this.isFetching.weight = false;
this.weight = data.weight || null;
this.weight = typeof weight === 'number' ? Number(weight) : null;
}
setWeight(newWeight) {
......
---
title: Support 0 weight in issue sidebar
merge_request: 14683
author:
type: fixed
......@@ -17,16 +17,28 @@ describe('EE Sidebar store', () => {
CESidebarStore.singleton = null;
});
it('sets weight data', () => {
expect(store.weight).toEqual(null);
describe('setWeightData', () => {
beforeEach(() => {
expect(store.weight).toEqual(null);
});
it('sets weight data', () => {
const weight = 3;
store.setWeightData({
weight,
});
const weight = 3;
store.setWeightData({
weight,
expect(store.isFetching.weight).toEqual(false);
expect(store.weight).toEqual(weight);
});
expect(store.isFetching.weight).toEqual(false);
expect(store.weight).toEqual(weight);
it('supports 0 weight', () => {
store.setWeightData({
weight: 0,
});
expect(store.weight).toBe(0);
});
});
it('set weight', () => {
......
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