-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-2.7.0' of https://github.com/Sunbird-Ed/sunbird…
…-mobile-sdk into release-2.7.0
- Loading branch information
Showing
17 changed files
with
348 additions
and
96 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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
47 changes: 47 additions & 0 deletions
47
src/content/handlers/get-content-heirarchy-handler.spec.ts
This file contains 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,47 @@ | ||
import { GetContentHeirarchyHandler } from './get-content-heirarchy-handler'; | ||
import { ApiService } from '../..'; | ||
import { ContentServiceConfig, ContentDetailRequest } from '..'; | ||
import { of } from 'rxjs'; | ||
|
||
describe('GetContentHeirarchyHandler', () => { | ||
let getContentHeirarchyHandler: GetContentHeirarchyHandler; | ||
const mockApiService: Partial<ApiService> = {}; | ||
const mockContentServiceConfig: Partial<ContentServiceConfig> = {}; | ||
|
||
beforeAll(() => { | ||
getContentHeirarchyHandler = new GetContentHeirarchyHandler( | ||
mockApiService as ApiService, | ||
mockContentServiceConfig as ContentServiceConfig | ||
); | ||
}); | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('should be create a instance of getContentHeirarchyHandler', () => { | ||
expect(getContentHeirarchyHandler).toBeTruthy(); | ||
}); | ||
|
||
it('shpuld handle mapContentFromContentHeirarchyData by invoked handle()', (done) => { | ||
// arrange | ||
const request: ContentDetailRequest = { | ||
contentId: 'do_123' | ||
}; | ||
mockApiService.fetch = jest.fn(() => of({ | ||
body: { | ||
result: { | ||
content: { | ||
children: ['child-1', 'child-2'] | ||
} | ||
} | ||
} | ||
})); | ||
// act | ||
getContentHeirarchyHandler.handle(request).subscribe(() => { | ||
expect(mockApiService.fetch).toHaveBeenCalled(); | ||
done(); | ||
}); | ||
// assert | ||
}); | ||
}); |
This file contains 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 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 +1 @@ | ||
export {Batch} from 'sunbird-client-data-models'; | ||
export {Batch} from '@project-sunbird/client-services'; |
This file contains 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 +1 @@ | ||
export {Course, CourseCertificate} from 'sunbird-client-data-models'; | ||
export {Course, CourseCertificate} from '@project-sunbird/client-services'; |
This file contains 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 +1 @@ | ||
export {Faq, Faqs} from 'sunbird-client-data-models'; | ||
export {Faq, Faqs} from '@project-sunbird/client-services'; |
This file contains 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 +1 @@ | ||
export {Channel} from 'sunbird-client-data-models'; | ||
export {Channel} from '@project-sunbird/client-services'; |
This file contains 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 +1 @@ | ||
export {FrameworkCategoryCode, FrameworkCategoryCodesGroup} from 'sunbird-client-data-models'; | ||
export {FrameworkCategoryCode, FrameworkCategoryCodesGroup} from '@project-sunbird/client-services'; |
This file contains 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 +1 @@ | ||
export {Framework, FrameworkCategory, CategoryTerm, CategoryAssociation} from 'sunbird-client-data-models'; | ||
export {Framework, FrameworkCategory, CategoryTerm, CategoryAssociation} from '@project-sunbird/client-services'; |
This file contains 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 +1 @@ | ||
export {PageAssemble, PageSections} from 'sunbird-client-data-models'; | ||
export {PageAssemble, PageSections} from '@project-sunbird/client-services'; |
This file contains 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 +1 @@ | ||
export {User as ServerProfile, RootOrg} from 'sunbird-client-data-models'; | ||
export {User as ServerProfile, RootOrg} from '@project-sunbird/client-services'; |
Oops, something went wrong.