Skip to content

Commit

Permalink
fix: updated the test
Browse files Browse the repository at this point in the history
  • Loading branch information
Savio629 committed Aug 21, 2024
1 parent 935db66 commit e31ebe9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/common/src/interceptors/test/geoip.interceptor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ describe('GeoIPInterceptor', () => {
let logger: Logger;

beforeEach(async () => {

const allowedCountries = ['India'];

const allowedCities = ['Mumbai'];
const allowedCoordinates = [{ lat: 19.0760, lon: 72.8777 }];
const allowedGeofences = [{ lat: 19.0760, lon: 72.8777, radius: 100 }];
const mockHttpService = {
axiosRef: {
get: jest.fn(),
Expand All @@ -43,7 +46,12 @@ describe('GeoIPInterceptor', () => {
},
{
provide: GeoIPInterceptor,
useFactory: () => new GeoIPInterceptor(allowedCountries),
useFactory: () => new GeoIPInterceptor({
countries: ['India', 'United States'],
cities: ['Mumbai', 'New York'],
coordinates: [{ lat: 35.6897, lon: 139.6895 }], // Tokyo
geofences: [{ lat: 51.5074, lon: -0.1278, radius: 50 }], // London, UK
}),
},
],
}).compile();
Expand Down

0 comments on commit e31ebe9

Please sign in to comment.