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

feat: move deleteusers tests to a separate file #1551

Merged
merged 12 commits into from
Nov 14, 2022

Conversation

sanpj2292
Copy link
Contributor

Description of the change

The intention through this PR is to move the deleteUsers tests to a different file rather than have it in proxy tests. In the same way, it is seen that we have different responses and axios is being used in different ways. To mock all of them in a generic we have implemented a generic axios mock client through which deleteUsers test-cases are being executed

Note: This generic axios mock client is being currently used by only GA. All other destinations(for deleteUsers) are using the earlier mock client(mockedAxiosClient)

In brief the changes are:

  • implement general axios mock client
  • test of the general mock axios client
  • implement unit tests using the general mock axios client
  • new way of defining the http responses

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

- implement general axios mock client
- test of the general mock axios client
- implement unit tests using the general mock axios client
- new way of defining the http responses
@sanpj2292 sanpj2292 self-assigned this Nov 5, 2022
@sanpj2292 sanpj2292 requested a review from a team as a code owner November 5, 2022 01:31
@sanpj2292 sanpj2292 requested review from yashasvibajpai, sandeepdsvs and a team and removed request for a team November 5, 2022 01:31
@sanpj2292 sanpj2292 requested a review from a team November 8, 2022 04:57
@sanpj2292 sanpj2292 added enhancement New feature or request and removed enhancement New feature or request labels Nov 8, 2022
__tests__/genAxios.test.js Show resolved Hide resolved
__tests__/deleteUsers.test.js Outdated Show resolved Hide resolved
__tests__/genAxios.test.js Show resolved Hide resolved
__tests__/deleteUsers.test.js Outdated Show resolved Hide resolved
@sanpj2292 sanpj2292 requested a review from a team November 9, 2022 10:28
Copy link
Contributor

@koladilip koladilip left a comment

Choose a reason for hiding this comment

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

Partial review only

__tests__/deleteUsers.test.js Outdated Show resolved Hide resolved
@sanpj2292 sanpj2292 merged commit dc6ca1c into feat.ga-reg-support Nov 14, 2022
krishna2020 pushed a commit that referenced this pull request Nov 24, 2022
* feat�: regulation api support for universal analytics initial commit

* modify deleteUsers api to include errorCategory, auth to send delete req to UA

* - correctly getting status code while error is thrown (using ErrorBuilder)
- mock koa context's get method
- implement a callback to get the header value

* adding secret validation

* remove unnecessary code

* add first successful test-case for ga delete support

Signed-off-by: Sai Sankeerth <[email protected]>

* remove comment

* rename variable

* new convention of parsing responses

* feat: move deleteusers tests to a separate file (#1551)

* extending common validations functions in all delete users supported destinations

* add test-case for erreneous scenario in a deleteUser request
- update the error message to include actual destination message for normal errors

* support for exclusion of destination for troubleshooting

Signed-off-by: Sai Sankeerth <[email protected]>
Co-authored-by: Sai Sankeerth <[email protected]>
@github-actions github-actions bot deleted the feat.ga-reg-support-axios-tests branch March 15, 2023 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants