Skip to content

Commit

Permalink
fix(queryBuilder): Fix unit tests
Browse files Browse the repository at this point in the history
two merge errors, one real bug
  • Loading branch information
atruskie committed Sep 16, 2016
1 parent c7c5fbf commit 907e31f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/services/queryBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ angular
const queryStringWhiteList = {
filter: filterToQueryString,
paging: (pagingObject) => Object.entries(pagingObject),
projection: (projectionObject) => Object.entries(projectionObject).map(([k,v]) => ["projection_" + k, v]),
projection: (projectionObject) => Object.entries(projectionObject).map(([k,v]) => ["projection_" + k, v.join(",")]),
sorting: (sortObject) => Object.entries(sortObject)
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/services/queryBuilder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ describe("The QueryBuilder", function () {
it("should be able to load a very complex query", function () {
var actual = queryBuilder.load(complexExpected);

expect(actual.toJSON(spaces)).toBe(j(complexExpected));
expect(j(actual.toJSON())).toBe(j(complexExpected));
});

describe("URL subset", function () {
Expand Down Expand Up @@ -979,7 +979,7 @@ describe("The QueryBuilder", function () {
{page: 1, items: 10}
).end();

expect(actual.toJSON(spaces)).toBe(j(expectedFilter));
expect(j(actual.toJSON())).toBe(j(expectedFilter));

let qsObj = actual.toQueryString();
let url = $url.formatUri("www.test.com/index.html", qsObj);
Expand Down

0 comments on commit 907e31f

Please sign in to comment.