Skip to content

Commit

Permalink
Fix of oppia#16356: Context service flake (oppia#16377)
Browse files Browse the repository at this point in the history
* translatioflake

* removed

* done

* nice
  • Loading branch information
heyimShivam authored Oct 23, 2022
1 parent 701421f commit 614bdc7
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ describe('Translation tab component', () => {
closeTour() {}
}

class MockUserExplorationPermissionsService {
getPermissionsAsync() {
return Promise.resolve({
canVoiceover: true
} as ExplorationPermissions);
}

fetchPermissionsAsync() {
return Promise.resolve({
canVoiceover: true
} as ExplorationPermissions);
}
}

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
Expand All @@ -99,6 +113,15 @@ describe('Translation tab component', () => {
JoyrideStepService,
JoyrideOptionsService,
JoyrideStepsContainerService,
// The UserExplorationPermissionsService has been
// mocked here because spying the function of
// UserExplorationPermissionsService is not able to
// stop afterAll error i.e. ContextService should not
// be used outside the context of an exploration or a question.
{
provide: UserExplorationPermissionsService,
useClass: MockUserExplorationPermissionsService,
},
{
provide: JoyrideService,
useClass: MockJoyrideService,
Expand Down

0 comments on commit 614bdc7

Please sign in to comment.