diff --git a/modules/entry/front/buy/index/index.js b/modules/entry/front/buy/index/index.js index 2f2588cde..6d9ee5760 100644 --- a/modules/entry/front/buy/index/index.js +++ b/modules/entry/front/buy/index/index.js @@ -58,11 +58,11 @@ export default class Controller extends Section { } toggleGroupingMode(buy, mode) { - const groupingFk = 1; - const packingFk = 2; - const grouingMode = mode === 'grouping' ? groupingFk : packingFk; + const grouping = 1; + const packing = 2; + const groupingMode = mode === 'grouping' ? grouping : packing; - const newGroupingMode = buy.groupingMode === grouingMode ? 0 : grouingMode; + const newGroupingMode = buy.groupingMode === groupingMode ? 0 : groupingMode; const params = { groupingMode: newGroupingMode diff --git a/modules/entry/front/buy/index/index.spec.js b/modules/entry/front/buy/index/index.spec.js index b9884acb1..aff52bc80 100644 --- a/modules/entry/front/buy/index/index.spec.js +++ b/modules/entry/front/buy/index/index.spec.js @@ -68,45 +68,45 @@ describe('Entry buy', () => { describe('toggleGroupingMode()', () => { it(`should toggle grouping mode from grouping to packing`, () => { - const groupingFk = 1; - const packingFk = 2; - const buy = {id: 999, groupingMode: groupingFk}; + const grouping = 1; + const packing = 2; + const buy = {id: 999, groupingMode: grouping}; const query = `Buys/${buy.id}`; - $httpBackend.expectPATCH(query, {groupingMode: packingFk}).respond(200); + $httpBackend.expectPATCH(query, {groupingMode: packing}).respond(200); controller.toggleGroupingMode(buy, 'packing'); $httpBackend.flush(); }); it(`should toggle grouping mode from packing to grouping`, () => { - const groupingFk = 1; - const packingFk = 2; - const buy = {id: 999, groupingMode: packingFk}; + const grouping = 1; + const packing = 2; + const buy = {id: 999, groupingMode: packing}; const query = `Buys/${buy.id}`; - $httpBackend.expectPATCH(query, {groupingMode: groupingFk}).respond(200); + $httpBackend.expectPATCH(query, {groupingMode: grouping}).respond(200); controller.toggleGroupingMode(buy, 'grouping'); $httpBackend.flush(); }); it(`should toggle off the grouping mode if it was packing to packing`, () => { - const noGroupingFk = 0; - const packingFk = 2; - const buy = {id: 999, groupingMode: packingFk}; + const noGrouping = 0; + const packing = 2; + const buy = {id: 999, groupingMode: packing}; const query = `Buys/${buy.id}`; - $httpBackend.expectPATCH(query, {groupingMode: noGroupingFk}).respond(200); + $httpBackend.expectPATCH(query, {groupingMode: noGrouping}).respond(200); controller.toggleGroupingMode(buy, 'packing'); $httpBackend.flush(); }); it(`should toggle off the grouping mode if it was grouping to grouping`, () => { - const noGroupingFk = 0; - const groupingFk = 1; - const buy = {id: 999, groupingMode: groupingFk}; + const noGrouping = 0; + const grouping = 1; + const buy = {id: 999, groupingMode: grouping}; const query = `Buys/${buy.id}`; - $httpBackend.expectPATCH(query, {groupingMode: noGroupingFk}).respond(200); + $httpBackend.expectPATCH(query, {groupingMode: noGrouping}).respond(200); controller.toggleGroupingMode(buy, 'grouping'); $httpBackend.flush(); });