Skip to content

Commit 75d6105

Browse files
author
thegreatyamori
committed
Merge b TT-178-Make-URI-clickable-when-possible
2 parents f655655 + 17fd3e1 commit 75d6105

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { MockStore, provideMockStore } from '@ngrx/store/testing';
33
import { Entry } from 'src/app/modules/shared/models';
44
import { SubstractDatePipe } from 'src/app/modules/shared/pipes/substract-date/substract-date.pipe';
55
import { getReportDataSource } from 'src/app/modules/time-clock/store/entry.selectors';
6-
import { entryReducer, EntryState } from '../../../time-clock/store/entry.reducer';
6+
import { EntryState } from '../../../time-clock/store/entry.reducer';
77
import { TimeEntriesTableComponent } from './time-entries-table.component';
88

99
describe('Reports Page', () => {
@@ -76,12 +76,13 @@ describe('Reports Page', () => {
7676
expect(component.dtTrigger.next).toHaveBeenCalled();
7777
});
7878

79-
it('when the uri starts with http or https it should return true and open the url in a new tab', () => {
79+
fit('when the uri starts with http or https it should return true and open the url in a new tab', () => {
8080
const uriExpected = 'http://customuri.com';
81+
spyOn(window, 'open');
8182
// TODO: test te objet windows.open spyOnProperty(window, 'open').and.returnValue(true);
8283
const isValidUri = uriExpected.startsWith('http' || 'https');
8384
expect(isValidUri).toBeTrue();
84-
// expect(window.open).toHaveBeenCalled();
85+
expect(window.open).toHaveBeenCalled();
8586
});
8687

8788
it('when the uri starts without http or https it should return false and not navigate or open a new tab', () => {

src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild, NgModule } from
33
import { select, Store } from '@ngrx/store';
44
import { DataTableDirective } from 'angular-datatables';
55
import * as moment from 'moment';
6-
import { getMaxListeners } from 'process';
76
import { Observable, Subject } from 'rxjs';
87
import { Entry } from 'src/app/modules/shared/models';
98
import { DataSource } from 'src/app/modules/shared/models/data-source.model';
109

11-
import { entryReducer, EntryState } from '../../../time-clock/store/entry.reducer';
10+
import { EntryState } from '../../../time-clock/store/entry.reducer';
1211
import { getReportDataSource } from '../../../time-clock/store/entry.selectors';
1312

1413
@Component({

0 commit comments

Comments
 (0)