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

Added unit tests for admin roles tab #13206

Merged
merged 7 commits into from
Jul 6, 2021

Conversation

Radesh-kumar
Copy link
Contributor

Overview

  1. This PR fixes or fixes part of #[fill_in_number_here].
  2. This PR does the following: [Explain here what your PR does and why]

Essential Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The linter/Karma presubmit checks have passed locally on your machine.
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)
    • This lets reviewers restart your CircleCI tests for you.
  • The PR is made from a branch that's not called "develop".

Proof that changes are correct

PR Pointers

  • Make sure to follow the instructions for making a code change.
  • Oppiabot will notify you when you don't add a PR_CHANGELOG label. If you are unable to do so, please @-mention a code owner (who will be in the Reviewers list), or ask on Gitter.
  • For what code owners will expect, see the Code Owner's wiki page.
  • Make sure your PR follows conventions in the style guide, otherwise this will lead to review delays.
  • Never force push. If you do, your PR will be closed.
  • Oppiabot can assign anyone for review/help if you leave a comment like the following: "{{Question/comment}} @{{reviewer_username}} PTAL"
  • Some of the e2e tests are flaky, and can fail for reasons unrelated to your PR. We are working on fixing this, but in the meantime, if you need to restart the tests, please check the "If your build fails" wiki page.

@oppiabot
Copy link

oppiabot bot commented Jun 25, 2021

Hi @Radesh-kumar, can you complete the following:

  1. The body of this PR is missing the required description, please update the body with a description of what this PR does.
  2. The proof that changes are correct has not been provided, please make sure to upload a image/video showing that the changes are correct. Or include a sentence saying "No proof of changes needed because" and the reason why proof of changes cannot be provided.
    Thanks!

@oppiabot
Copy link

oppiabot bot commented Jun 25, 2021

Hi @Radesh-kumar please assign the required reviewer(s) for this PR. Thanks!

@Radesh-kumar
Copy link
Contributor Author

@oppiabot
Copy link

oppiabot bot commented Jun 25, 2021

Unassigning @Radesh-kumar since a re-review was requested. @Radesh-kumar, please make sure you have addressed all review comments. Thanks!

Copy link
Contributor

@aishwary023 aishwary023 left a comment

Choose a reason for hiding this comment

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

LGTM! Left a few minor nits, PTAL, thanks!

@@ -183,7 +183,7 @@
class="btn btn-success protractor-test-contribution-rights-form-submit-button"
[disabled]="!formData.viewContributionReviewers.isValid()"
value="view role">
View Role
View Contributors
Copy link
Contributor

Choose a reason for hiding this comment

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

Just making sure if this change was intentional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup this is intentional

Copy link
Member

Choose a reason for hiding this comment

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

Can you please leave an explanation for this change? [This will help reviewers to quickly approve the changes!]

Copy link
Contributor Author

@Radesh-kumar Radesh-kumar Jun 28, 2021

Choose a reason for hiding this comment

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

Screenshot from 2021-06-28 16-06-09

Currently, we have two categories of roles.
One is actual roles (admin, collection editor, moderator...)
Another one is contributor rights.
We are actually viewing contributors/ or contributor rights, In order to sync with other two buttons add rights and remove rights I've made this change.

expect(component.userRolesResult).toEqual({});
}));

it('should handle error responses sent form the backend', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

*from or maybe use by

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}));

it('should not send request to backend if a task ' +
'is still running in the que', fakeAsync(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

*queue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}));

it('should not send request to backend if a task ' +
'is still running in the que', fakeAsync(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}));

it('should not send request to backend if a task ' +
'is still running in the que', fakeAsync(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

'Success.');
}));

it('should not send request to backend if a task ' +
Copy link
Contributor

Choose a reason for hiding this comment

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

This test description seems to be repeated throughout the file -- maybe modify it to describe the type of request, so that the descriptions are distinguishable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

please note that we have different describe blocks for each case.

@oppiabot
Copy link

oppiabot bot commented Jun 26, 2021

Unassigning @aishwary023 since they have already approved the PR.

@Radesh-kumar
Copy link
Contributor Author

PTAL @nithusha21 @DubeySandeep

@@ -183,7 +183,7 @@
class="btn btn-success protractor-test-contribution-rights-form-submit-button"
[disabled]="!formData.viewContributionReviewers.isValid()"
value="view role">
View Role
View Contributors
Copy link
Member

Choose a reason for hiding this comment

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

Can you please leave an explanation for this change? [This will help reviewers to quickly approve the changes!]

@oppiabot
Copy link

oppiabot bot commented Jun 28, 2021

Unassigning @DubeySandeep since the review is done.

@oppiabot
Copy link

oppiabot bot commented Jun 28, 2021

Hi @Radesh-kumar, it looks like some changes were requested on this pull request by @DubeySandeep. PTAL. Thanks!

@Radesh-kumar
Copy link
Contributor Author

PTAL @DubeySandeep

@oppiabot oppiabot bot assigned DubeySandeep and unassigned Radesh-kumar Jun 28, 2021
@oppiabot
Copy link

oppiabot bot commented Jun 28, 2021

Unassigning @Radesh-kumar since a re-review was requested. @Radesh-kumar, please make sure you have addressed all review comments. Thanks!

Copy link
Contributor

@nithusha21 nithusha21 left a comment

Choose a reason for hiding this comment

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

I think this looks good!

@oppiabot
Copy link

oppiabot bot commented Jun 28, 2021

Unassigning @nithusha21 since they have already approved the PR.

@oppiabot
Copy link

oppiabot bot commented Jun 29, 2021

Hi @Radesh-kumar, the build of this PR is stale and this could result in tests failing in develop. Please update this pull request with the latest changes from develop. Thanks!

@Radesh-kumar
Copy link
Contributor Author

PTAL @DubeySandeep

@oppiabot
Copy link

oppiabot bot commented Jun 30, 2021

Hi @Radesh-kumar. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@Radesh-kumar
Copy link
Contributor Author

PTAL @DubeySandeep

@oppiabot
Copy link

oppiabot bot commented Jul 4, 2021

Hi @Radesh-kumar, the build of this PR is stale and this could result in tests failing in develop. Please update this pull request with the latest changes from develop. Thanks!

@DubeySandeep DubeySandeep merged commit 220c03a into oppia:develop Jul 6, 2021
brianrodri added a commit to brianrodri/oppia that referenced this pull request Jul 8, 2021
commit 1daef35
Author: Brian Rodriguez <brian@brianrodri.com>
Date:   Wed Jul 7 23:37:43 2021 -0400

    fix lint

commit c45ac4e
Merge: 76360a5 aae335d
Author: Brian Rodriguez <brian@brianrodri.com>
Date:   Wed Jul 7 23:25:52 2021 -0400

    Merge branch 'fix-pylint' into index-all-activities

commit aae335d
Author: Brian Rodriguez <brian@brianrodri.com>
Date:   Wed Jul 7 23:20:26 2021 -0400

    Fix part of oppia#12718: Use init-hook to fix command line calls to pylint

commit 76360a5
Author: Brian Rodriguez <brian@brianrodri.com>
Date:   Wed Jul 7 23:03:22 2021 -0400

    replace index-all-activities-job

commit 1cb69a8
Author: Praneeth <praneethg2001@gmail.com>
Date:   Thu Jul 8 04:09:09 2021 +0530

    Fixes Typescript issue in oppia-short-response-mulitple-choice-input.component and mypy issue in schema_utils.py (oppia#13335)

    * minor fixes

    * mypy fix

commit e2e59bd
Author: Praneeth <praneethg2001@gmail.com>
Date:   Thu Jul 8 00:04:55 2021 +0530

    Frontend Unit Tests(3): Cover multiple component files (oppia#13303)

    * intial commit

    * minor fix

commit 186435d
Author: Hardik Katehara <54679643+hardikkat24@users.noreply.github.com>
Date:   Wed Jul 7 22:44:02 2021 +0530

    Fix oppia#13239 and oppia#13171: Adding type annotations to root files and fix constants errors with mypy (oppia#13269)

commit 7f5757f
Author: EeshaArif <43031234+EeshaArif@users.noreply.github.com>
Date:   Wed Jul 7 22:13:10 2021 +0500

    Fix Part of oppia#10474: Cover some files with TS strict checks - 6 (oppia#13263)

commit 1577479
Author: Nikhil <57531197+Nik-09@users.noreply.github.com>
Date:   Wed Jul 7 21:21:14 2021 +0530

    Adds schema for handlers concept_card_viewer & contributor_dashboard modules (oppia#13225)

    * payload_validator(created) + schema_utils(modified) for SVS architecture

    * payload

    * validate_args_schema in base + backend tests

    * Adds linters to verify handlers must have schema

    * Shows exception message in frontend when SVS validation fails.

    * adds schema in backend test

    * fix coverage

    * adds backend test for payload_validator into shard 1.

    * Changes logic for handling default_value cases.

    * removes dict from properties list in schema utils

    * fix coverage

    * changes codeowners

    * Adds backend unit tests + comments + docstrings

    * fix coverage

    * adds backend tests for coverage

    * fix coverage

    * adds backend tests for coverage

    * fix coverage

    * fix coverage

    * adds test into shard

    * backend coverage

    * fix coverage

    * structured backend test.

    * adds docstring

    * fix coverage

    * changes formatting for schema in MockHandlers

    * refactor domain objects validator

    * refactor handling object_dict

    * fixes backend tests.

    * validate_method -> validation_method

    * adds extra checks in backend test.

    * updates comment

    * adds backend tests.

    * Addressed review comments.

    * fix coverage

    * Addressed review comments.

    * fixes backend tests for linters

    * Addressed review comments.

    * updates loop into list comprehension.

    * addressed review comments

    * fix coverage

    * addressed review comments.

    * addressed review comments

    * addressed review comments.

    * fix coverage

    * addressed review comments

    * fix coverage

    * remove repeted code.

    * addressed review comments.

    * removes duplicate code from payload_validator

    * fix backend tests

    * schemas for contributor_dashboard+concept_card_viewer

    * fixes backend tests

    * updates logic for handling optional cases

    * fixes backend tests

    * adds backend coverage tests

    * refactores payload validator

    * adds schema type string

    * adds handler class name in old handlers list

    * fixes backend tests

    * fix coverage

    * removes dead code.

    * makes backend code typed.

    * adds new handler class in old handler

    * addressed review comments

    * fix coverage

    * fix coverage

    * updates logic for handling normalized value

    * changes string -> basestring

    * updates schema.

    * updates schemas

    * addressed review comments

    * updates by adding schema key 'schema'

    * adds validator for language code.

    * fix coverage

    * adds comment and updates docstring.

    * udates comment.

    * updates comment

    * updates comment

    * updates comment

    * updates schemas

    * changes docstring.

    * updates logic to handle csrf and source

    * fixes backend tests

    * updates logic to raise 400

    * updates logic to handle source

    * updates logic

    * removes if-block in dispatch method

    * adds previous if-else logic to handle source

    * updates if into elif

    * adds comment in csrf_token

    * updates logic and adds tests for backend coverage.

    * fixes coverage

    * updates comment

    * uses sanitize url instead of regex.

    * fix coverage

    * fix coverage.

    * uses regex to check source url.

commit f9a5144
Author: Ashutosh Chauhan <ashutoshc8101@gmail.com>
Date:   Wed Jul 7 16:10:51 2021 +0530

    Fix part of oppia#9749: Migrate Preferences page (oppia#13219)

commit 6b1f473
Author: Brian Rodriguez <brian@brianrodri.com>
Date:   Wed Jul 7 00:31:34 2021 -0400

    Fix part of oppia#11475: Delete all references to continuous jobs (oppia#13313)

    * Removed notification page

    * Fixed merge conflict file

    * Fixed ts error

    * Removed notification from accessiblity test

    * Fixed JS lint issue

    * Changed the shortcut for preferenceURL

    * additional nits

    * Fixed ts error

    * reverting removal of userbackend service

    * Added back the changes

    * Delete FeedbackAnalyticsAggregator

    * fix unused code

    * add PR to note

    * small nit

    * address comments

    * initial attempt

    * initial attempt

    * fix ratings test

    * delete file

    * reduce untested lines

    * fix lint

    * remove frontend references to continuous jobs

    * remove backend references to continuous jobs

    * remove checks for events

    * fix lint

    * delete QUEUE_NAME_EVENTS

    * delete events from queue.yaml

    * fix bugs

    * fix queue.yaml tests

    * fix coverage

    * fix lint

    Co-authored-by: Aasif Faizal <aasif.faizal@gmail.com>

commit 4c64eee
Author: Rijuta Singh <68547101+Rijuta-s@users.noreply.github.com>
Date:   Wed Jul 7 06:47:32 2021 +0530

    Milestone 1.5 : Adds blog admin page frontend. (oppia#13300)

    * Adding blog admin page

    * adding blog admin page

    * fixing lint

    * minor fixes

    * [ci skip] adding spec file

    * adding spec file

    * applying suggestions

    * applying suggestions

    * Applting lint suggestions

    * applying suggestions

    * fixing lint issues

    * sdcsd

    * applying suggestions

    * Revert  adding root component files

    This reverts commit 6bd0d76.

    * applying suggestions

    * minor fix

commit a2f9d14
Author: Aishwary Saxena <aishwary.saxena.min19@itbhu.ac.in>
Date:   Tue Jul 6 18:09:15 2021 +0530

    Unit test for questions-list.component.ts (oppia#13287)

    * Converted AJS Directive to AJS Component

    * Added tests

    * Added tests, completed 100%

    * Fixed lint checks

    * fix karma conf

    * Addressed review

commit 79e6d10
Author: Aishwary Saxena <aishwary.saxena.min19@itbhu.ac.in>
Date:   Tue Jul 6 14:49:00 2021 +0530

    Unit test for exploration creation service (oppia#13176)

    * Added tests

    * Lint err

    * Added callback for dataFilter

    * Removed file name from NOT_FULLY_COVERED_FILENAMES

    * Added expectations

    * Nit

    * Nit

    * Addressed review

    * Removed fdescribe

    * Addressed review

    * lint

    * Removed mock

    * Fix

    * removed fdescribe

commit e0a39a2
Author: Farees Hussain <fareezzhussain@gmail.com>
Date:   Tue Jul 6 13:14:13 2021 +0530

    Fix oppia#13172: Controller to initialize android specific structures (Milestone 1.2) (oppia#13174)

    * controller to initiate android specific structures

    * fix linters

    * using variable for exploration id

    * fix linters

    * upload thumbnails

    * added tests

    * fix linters

    * remove csrf token

    * added to shards

    * refactoring and testcases

    * fix CI checks

    * fix CI

    * Addressed requested changes

    * rename test

    * timeout 30 with comment

    * fix linter

    * remove post_req

    * added render_json

    * NIT

    * changed comment

    * whitespace

    * requested changes

    * more docs

    * NIT

    * docstring update

    * addressed suggestions

    * replaced 500 with 400

    * update docstring

    * updated docstring

commit d12bfc1
Author: Kevin Thomas <kevintab@tutanota.com>
Date:   Tue Jul 6 12:08:19 2021 +0530

    Fix typescript check failure (oppia#13321)

commit c037e83
Author: Kevin Thomas <kevintab@tutanota.com>
Date:   Tue Jul 6 11:33:46 2021 +0530

    Modify translation submission validation to check for custom tags (oppia#13309)

commit 220c03a
Author: Radesh <54100702+Radesh-kumar@users.noreply.github.com>
Date:   Tue Jul 6 10:42:21 2021 +0530

    Added unit tests for admin roles tab (oppia#13206)

commit 56a9e43
Author: Kevin Thomas <kevintab@tutanota.com>
Date:   Tue Jul 6 09:57:02 2021 +0530

    Add Marathi (मराठी) and Ganda (Luganda) to supported languages (oppia#13315)

commit c82945e
Author: AdityaDubey0 <55298925+AdityaDubey0@users.noreply.github.com>
Date:   Tue Jul 6 03:53:03 2021 +0530

    Migrate lint check to disallow innerHTML property. (oppia#13301)

commit 901bc8b
Author: Hitesh Tomar <44300735+lkbhitesh07@users.noreply.github.com>
Date:   Tue Jul 6 02:33:38 2021 +0530

    warning text is within the box (oppia#13296)

commit 90d0152
Author: AdityaDubey0 <55298925+AdityaDubey0@users.noreply.github.com>
Date:   Tue Jul 6 01:45:41 2021 +0530

    Disallow $parent and $broadcast angularJs property (oppia#13291)
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