Skip to content

Commit 38be420

Browse files
author
Juan Gabriel Guzman
committed
style: #201 Removing unnecessary code and fixing typos
1 parent 7a1bfa5 commit 38be420

File tree

6 files changed

+14
-24
lines changed

6 files changed

+14
-24
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
},
7676
"config": {
7777
"commit-message-validator": {
78-
"pattern": "^(fix: #|feat: #|perf: #)[0-9].*",
78+
"pattern": "^(fix: #|feat: #|perf: #|style: #)[0-9].*",
7979
"errorMessage": "Your commit message needs to start with fix:, feat:, or perf: followed by issue number, e.g. fix: #43 any commit message"
8080
}
8181
},

src/app/modules/time-clock/pages/time-clock.component.spec.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { provideMockStore, MockStore } from '@ngrx/store/testing';
66
import { TimeClockComponent } from './time-clock.component';
77
import { ProjectState } from '../../customer-management/components/projects/components/store/project.reducer';
88
import { ProjectListHoverComponent } from '../components';
9-
import { ProjectService } from '../../customer-management/components/projects/components/services/project.service';
109
import { FilterProjectPipe } from '../../shared/pipes';
1110
import { AzureAdB2CService } from '../../login/services/azure.ad.b2c.service';
1211
import {ActionsSubject} from '@ngrx/store';
@@ -15,7 +14,6 @@ describe('TimeClockComponent', () => {
1514
let component: TimeClockComponent;
1615
let fixture: ComponentFixture<TimeClockComponent>;
1716
let store: MockStore<ProjectState>;
18-
let projectService: ProjectService;
1917
let azureAdB2CService: AzureAdB2CService;
2018
const actionSub: ActionsSubject = new ActionsSubject();
2119
const state = {
@@ -46,7 +44,7 @@ describe('TimeClockComponent', () => {
4644
TestBed.configureTestingModule({
4745
imports: [HttpClientTestingModule],
4846
declarations: [TimeClockComponent, ProjectListHoverComponent, FilterProjectPipe],
49-
providers: [ProjectService,
47+
providers: [
5048
AzureAdB2CService,
5149
{ provide: ActionsSubject, useValue: actionSub },
5250
provideMockStore({ initialState: state })],
@@ -58,7 +56,6 @@ describe('TimeClockComponent', () => {
5856
fixture = TestBed.createComponent(TimeClockComponent);
5957
component = fixture.componentInstance;
6058
fixture.detectChanges();
61-
projectService = TestBed.inject(ProjectService);
6259
azureAdB2CService = TestBed.inject(AzureAdB2CService);
6360
});
6461

@@ -82,13 +79,6 @@ describe('TimeClockComponent', () => {
8279
expect(azureAdB2CService.getName).toHaveBeenCalledTimes(0);
8380
});
8481

85-
it('Service injected via inject(...) and TestBed.get(...) should be the same instance', inject(
86-
[ProjectService],
87-
(injectService: ProjectService) => {
88-
expect(injectService).toBe(projectService);
89-
}
90-
));
91-
9282
it('clockOut dispatch a StopTimeEntryRunning action', () => {
9383
spyOn(store, 'dispatch');
9484

src/app/modules/time-clock/store/entry.actions.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ describe('Actions for Entries', () => {
2929
project_id: '1',
3030
description: 'It is good for learning',
3131
});
32-
expect(updateActiveEntrySuccess.type).toEqual(actions.EntryActionTypes.UDPATE_ACTIVE_ENTRY_SUCCESS);
32+
expect(updateActiveEntrySuccess.type).toEqual(actions.EntryActionTypes.UPDATE_ACTIVE_ENTRY_SUCCESS);
3333
});
3434

3535
it('UpdateActiveEntryFail type is EntryActionTypes.UDPATE_ACTIVE_ENTRY_FAIL', () => {
3636
const updateActiveEntryFail = new actions.UpdateActiveEntryFail('error');
37-
expect(updateActiveEntryFail.type).toEqual(actions.EntryActionTypes.UDPATE_ACTIVE_ENTRY_FAIL);
37+
expect(updateActiveEntryFail.type).toEqual(actions.EntryActionTypes.UPDATE_ACTIVE_ENTRY_FAIL);
3838
});
3939
});

src/app/modules/time-clock/store/entry.actions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export enum EntryActionTypes {
88
CREATE_ENTRY = '[Entry] CREATE_ENTRY',
99
CREATE_ENTRY_SUCCESS = '[Entry] CREATE_ENTRY_SUCCESS',
1010
CREATE_ENTRY_FAIL = '[Entry] CREATE_ENTRY_FAIL',
11-
UDPATE_ACTIVE_ENTRY = '[Entry] UDPATE_ACTIVE_ENTRY',
12-
UDPATE_ACTIVE_ENTRY_SUCCESS = '[Entry] UDPATE_ACTIVE_ENTRY_SUCCESS',
13-
UDPATE_ACTIVE_ENTRY_FAIL = '[Entry] UDPATE_ACTIVE_ENTRY_FAIL',
11+
UPDATE_ACTIVE_ENTRY = '[Entry] UPDATE_ACTIVE_ENTRY',
12+
UPDATE_ACTIVE_ENTRY_SUCCESS = '[Entry] UPDATE_ACTIVE_ENTRY_SUCCESS',
13+
UPDATE_ACTIVE_ENTRY_FAIL = '[Entry] UPDATE_ACTIVE_ENTRY_FAIL',
1414
STOP_TIME_ENTRY_RUNNING = '[Entry] STOP_TIME_ENTRIES_RUNNING',
1515
STOP_TIME_ENTRY_RUNNING_SUCCESS = '[Entry] STOP_TIME_ENTRIES_RUNNING_SUCCESS',
1616
STOP_TIME_ENTRY_RUNNING_FAILED = '[Entry] STOP_TIME_ENTRIES_RUNNING_FAILED',
@@ -50,19 +50,19 @@ export class CreateEntryFail implements Action {
5050
}
5151

5252
export class UpdateActiveEntry implements Action {
53-
public readonly type = EntryActionTypes.UDPATE_ACTIVE_ENTRY;
53+
public readonly type = EntryActionTypes.UPDATE_ACTIVE_ENTRY;
5454

5555
constructor(public payload: NewEntry) {}
5656
}
5757

5858
export class UpdateActiveEntrySuccess implements Action {
59-
public readonly type = EntryActionTypes.UDPATE_ACTIVE_ENTRY_SUCCESS;
59+
public readonly type = EntryActionTypes.UPDATE_ACTIVE_ENTRY_SUCCESS;
6060

6161
constructor(public payload: NewEntry) {}
6262
}
6363

6464
export class UpdateActiveEntryFail implements Action {
65-
public readonly type = EntryActionTypes.UDPATE_ACTIVE_ENTRY_FAIL;
65+
public readonly type = EntryActionTypes.UPDATE_ACTIVE_ENTRY_FAIL;
6666

6767
constructor(public error: string) {}
6868
}

src/app/modules/time-clock/store/entry.effects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class EntryEffects {
3939

4040
@Effect()
4141
updateActiveEntry$: Observable<Action> = this.actions$.pipe(
42-
ofType(actions.EntryActionTypes.UDPATE_ACTIVE_ENTRY),
42+
ofType(actions.EntryActionTypes.UPDATE_ACTIVE_ENTRY),
4343
map((action: actions.UpdateActiveEntry) => action.payload),
4444
mergeMap((project) =>
4545
this.entryService.updateActiveEntry(project).pipe(

src/app/modules/time-clock/store/entry.reducer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ export const entryReducer = (state: EntryState = initialState, action: EntryActi
6565
};
6666
}
6767

68-
case EntryActionTypes.UDPATE_ACTIVE_ENTRY: {
68+
case EntryActionTypes.UPDATE_ACTIVE_ENTRY: {
6969
return {
7070
...state,
7171
isLoading: true,
7272
};
7373
}
7474

75-
case EntryActionTypes.UDPATE_ACTIVE_ENTRY_SUCCESS: {
75+
case EntryActionTypes.UPDATE_ACTIVE_ENTRY_SUCCESS: {
7676
const activeEntry = { ...state.active, ...action.payload };
7777

7878
return {
@@ -82,7 +82,7 @@ export const entryReducer = (state: EntryState = initialState, action: EntryActi
8282
};
8383
}
8484

85-
case EntryActionTypes.UDPATE_ACTIVE_ENTRY_FAIL: {
85+
case EntryActionTypes.UPDATE_ACTIVE_ENTRY_FAIL: {
8686
return {
8787
...state,
8888
active: null,

0 commit comments

Comments
 (0)