Skip to content
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

Mock services: Implement mock polling and mock issue creation #579

Merged
merged 6 commits into from
Feb 9, 2021

Conversation

anubh-v
Copy link
Contributor

@anubh-v anubh-v commented Feb 6, 2021

This PR implements the createIssue and pollIssue methods of MockGithubService and MockIssueService respectively.
In these mocked methods, the actual GitHub API is not used, but simply imitated (e.g. createIssue simply returns a new GithubIssue, without using the GitHub API)

With these mocked methods, we can now create new bug reports in our end-to-end tests.

To test these changes: run npm run ng:serve:test.
This starts the app in "test" mode - the app will be using mocked services (hence the GitHub API will not be used).
You should be able to navigate to Bug Reporting Phase and create new bug reports.

Proposed commit message:

Mock services: Implement mock polling and mock issue creation

We cannot create new bug reports in our e2e tests,
as this process relies on the `createIssue` and `pollIssue` methods
of `MockGithubService` and `MockIssueService` respectively,
These methods have not been mocked yet.

Let's write mock implementations of `createIssue` and `pollIssue`,
so that we can create new bug reports in our e2e tests.

@anubh-v anubh-v requested a review from a team February 6, 2021 11:06
Copy link
Contributor

@ptvrajsk ptvrajsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

}

setLandingPageTitle(): void {
const appSetting = require('../../../../../package.json');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question here actually! Do we normally use relative or absolute paths for these kind of common files like package.json o.o

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanlowjk

Hmm so far it has been relative links. But we can look into defining an absolute path for package json to make it cleaner but its only used in about 2/3 places I think. Also to define an absolute path we'd need to modify the tsconfig?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhhh I see.....

Then I think as of now, we can just stick to relative paths :P

Copy link
Contributor Author

@anubh-v anubh-v Feb 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only seen relative paths used in this context. Is there a benefit to using absolute paths?

@anubh-v anubh-v merged commit a240044 into CATcher-org:master Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants