Skip to content

Commit

Permalink
Adds tests to support adding a meeting method filter to a location re…
Browse files Browse the repository at this point in the history
…source
  • Loading branch information
craigpaul committed May 19, 2020
1 parent b2cfb0a commit 055aec3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/resources/location.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import mockAxios from 'axios';

import Location from './location';
import MeetingMethods from "../constants/meeting-methods";
import { STORAGE_KEY } from '../helpers/token';
import Location from './location';

it('will set assigned filter', async () => {
const resource = new Location(mockAxios);
Expand Down Expand Up @@ -81,6 +82,14 @@ it('will set service filter using an array of strings', async () => {
});
});

it('will set meeting method filter using a number', async () => {
const resource = new Location(mockAxios);

expect(resource.supporting(MeetingMethods.PHONE_CALL)).toHaveProperty('filters', {
method: MeetingMethods.PHONE_CALL,
});
});

it('will set the physical locations only filter', async () => {
const resource = new Location(mockAxios);

Expand Down Expand Up @@ -142,6 +151,7 @@ it('can string all filterable options together', async () => {
.sortBy('created')
.physical()
.preferred()
.supporting(MeetingMethods.PHONE_CALL)
.located({ city: 'Fake City', country: 'FC', region: 'FR' })
.take(5)
.on(1),
Expand All @@ -152,6 +162,7 @@ it('can string all filterable options together', async () => {
city: 'Fake City',
country: 'FC',
invitable: 1,
method: MeetingMethods.PHONE_CALL,
preferred: 1,
region: 'FR',
services: [1, 2],
Expand Down Expand Up @@ -182,6 +193,7 @@ it('can get locations with additional parameters', async () => {
.invitable()
.physical()
.preferred()
.supporting(MeetingMethods.PHONE_CALL)
.located({ city: 'Fake City', country: 'FC', region: 'FR' })
.sortBy('created')
.take(5)
Expand All @@ -193,6 +205,7 @@ it('can get locations with additional parameters', async () => {
params: {
'filter[assignments]': 1,
'filter[city]': 'Fake City',
'filter[client_view_meeting_method]': MeetingMethods.PHONE_CALL,
'filter[country]': 'FC',
'filter[invite_only]': 1,
'filter[preferred]': 1,
Expand Down

0 comments on commit 055aec3

Please sign in to comment.