Skip to content

Commit

Permalink
test: test fragment extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
ElJocho committed Nov 2, 2023
1 parent bcf06fe commit cb086c3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/app/dashboard/dashboard.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ describe('DashboardComponent', () => {
],
providers: [
{ provide: DataService, useValue: dataServiceSpy },
{ provide: ActivatedRoute, useValue: { fragment: of('hashtags=missingmaps&interval=P1M') } },
{ provide: ActivatedRoute, useValue: { fragment: of('hashtags=missingmaps&interval=P1M&countries=DE,UGA') } },
]
})
.compileComponents();
Expand Down Expand Up @@ -284,6 +284,19 @@ describe('DashboardComponent', () => {
expect(params).toEqual(expectedParams);
});

it('should get query params from URL fragment', () => {
const fragment = 'start=2020-01-01T00:00:00.000Z&end=2020-12-31T00:00:00.000Z&countries=DE,UGA';
const expectedParams = {
start: '2020-01-01T00:00:00.000Z',
end: '2020-12-31T00:00:00.000Z',
countries: "DE,UGA"
};

const params = component.getQueryParamsFromFragments(fragment);

expect(params).toEqual(expectedParams);
});

// it('should call data service to fetch summary data', () => {
// const queryParams = {
// start: '2022-08-16T00:52:40.000Z',
Expand Down

0 comments on commit cb086c3

Please sign in to comment.