Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
umutozel committed Dec 5, 2018
1 parent 64df393 commit 03c013f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/odata-query-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export class ODataQueryProvider implements IQueryProvider {
else if (~thenFuncs.indexOf(part.type)) {
orders.push(part);
}
else if (!~otherFuncs.indexOf(part.type)) {
params[part.type] = part;
else if (~otherFuncs.indexOf(part.type)) {
params[part.type] = part.args[0];
}
else throw new Error(`${part.type} is not supported.`);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/odata-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export class ODataQuery<T> implements IODataQuery<T> {
export interface IODataQuery<T> extends IQueryBase {
inlineCount(value?: boolean): IODataQuery<T>;
where(predicate: Predicate<T>, ...scopes): IODataQuery<T>;
orderBy(keySelector: Func1<T>, ...scopes): IODataQuery<T>;
orderByDescending(keySelector: Func1<T>, ...scopes): IODataQuery<T>;
orderBy(keySelector: Func1<T>, ...scopes): IOrderedODataQuery<T>;
orderByDescending(keySelector: Func1<T>, ...scopes): IOrderedODataQuery<T>;
select<TResult = any>(selector: Func1<T, TResult>, ...scopes): IODataQuery<T>;
expand<TNav>(navigationSelector: Func2<T, TNav>, selector?: Func2<TNav, any>, ...scopes): IODataQuery<T>;
skip(count: number): IODataQuery<T>;
Expand Down
2 changes: 1 addition & 1 deletion test/fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ export class CompanyService extends ODataService {
}

companies() {
return this.createQuery<Company>('Companies').expand(c => c.addresses.$expand(a => a.city).country);
return this.createQuery<Company>('Companies');
}
}
2 changes: 1 addition & 1 deletion test/service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ describe('Service tests', () => {

const prm = provider.options.params[0];
expect(prm).property('key').to.equal('$orderby');
expect(prm).property('value').to.equal('id, name desc');
expect(prm).property('value').to.equal('id,name desc');
});
});

0 comments on commit 03c013f

Please sign in to comment.