sort.spec.js (678B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 const { 7 Sort, 8 sortReducer, 9 } = require("resource://devtools/client/netmonitor/src/reducers/sort.js"); 10 const { 11 SORT_BY, 12 } = require("resource://devtools/client/netmonitor/src/constants.js"); 13 14 describe("sorting reducer", () => { 15 it("it should sort by sort type", () => { 16 const initialState = new Sort(); 17 const action = { 18 type: SORT_BY, 19 sortType: "TimeWhen", 20 }; 21 const expectedState = { 22 type: "TimeWhen", 23 ascending: true, 24 }; 25 26 expect(expectedState).toEqual(sortReducer(initialState, action)); 27 }); 28 });