-
Notifications
You must be signed in to change notification settings - Fork 1
#29 Get Technologies #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
#29 Get Technologies #118
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1c57339
#29 Get Technologies
jorgecod bcd8e86
fix: #29 Add key
jorgecod d614c2c
fix: #29 Fix test
jorgecod 1fcb3cf
fix: #29 Fix comments
jorgecod d404655
fix: #29 fix coverage
jorgecod afc20cc
fix: #29 Refactor design
jorgecod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
#29 Get Technologies
- Loading branch information
commit 1c5733976d9050edcffedeb32c52d718dcef4dbd
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 46 additions & 16 deletions
62
src/app/modules/shared/components/details-fields/details-fields.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ export interface Entry { | |
startDate: string; | ||
endDate: string; | ||
activity: string; | ||
technology: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. technologies |
||
technology: string[]; | ||
comments?: string; | ||
ticket?: string; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './activity.model'; | ||
export * from './entry.model'; | ||
export * from './project.model'; | ||
export * from './technology.model'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface Technology { | ||
items: Array<any>; | ||
} |
Empty file.
45 changes: 45 additions & 0 deletions
45
src/app/modules/shared/services/technology.service.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { TestBed, inject } from '@angular/core/testing'; | ||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; | ||
import { Technology } from '../../shared/models'; | ||
import { TechnologyService } from './technology.service'; | ||
import { KEY } from '../../../../environments/environment'; | ||
|
||
describe('TechnologyService', () => { | ||
let service: TechnologyService; | ||
let httpMock: HttpTestingController; | ||
|
||
const technologyList: Technology = { items: [{ name: 'java' }, { name: 'javascript' }] }; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [HttpClientTestingModule], | ||
}); | ||
service = TestBed.inject(TechnologyService); | ||
httpMock = TestBed.inject(HttpTestingController); | ||
}); | ||
|
||
afterEach(() => { | ||
httpMock.verify(); | ||
}); | ||
|
||
it('should create', inject( | ||
[HttpClientTestingModule, TechnologyService], | ||
(httpClient: HttpClientTestingModule, apiService: TechnologyService) => { | ||
expect(apiService).toBeTruthy(); | ||
expect(httpClient).toBeTruthy(); | ||
} | ||
)); | ||
|
||
it('technologies are read using GET from url', () => { | ||
const technologyFoundSize = technologyList.items.length; | ||
const technologyName = 'java'; | ||
service.getTechnologies(technologyName).subscribe((technologyInResponse) => { | ||
expect(technologyInResponse.items.length).toBe(technologyFoundSize); | ||
}); | ||
const getTechnologiesRequest = httpMock.expectOne( | ||
`${service.baseUrl}&inname=${technologyName}&site=stackoverflow&key=${KEY}` | ||
); | ||
expect(getTechnologiesRequest.request.method).toBe('GET'); | ||
getTechnologiesRequest.flush(technologyList); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technologies or technology. it looks like technology since the type is not an array or any kind of collection.