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

Chore/client tests codestyle docs #1305

Merged
merged 174 commits into from
May 2, 2020
Merged

Conversation

krusche
Copy link
Member

@krusche krusche commented Apr 13, 2020

This PR is a collaborative effort to improve client tests, code style and documentation

Checklist

Motivation and Context

We have outdated tests, JSDoc comments in the client files are missing in several places and the code style of the tests is not always in a good shape.

This PR is an ongoing effort to collaboratively improve the client files and fix the mentioned issues:

  • Client code style
  • Fix all tests (or remove outdated ones)

It would be great if everyone can help to fix all issues in the next 2 weeks!

Stephan Krusche added 3 commits April 13, 2020 17:29
1) run all client tests
2) check documentation automatically
3) also check files in test folder for code style
@krusche krusche added tests client Pull requests that update TypeScript code. (Added Automatically!) documentation labels Apr 13, 2020
@krusche krusche requested review from jpbernius and a team as code owners April 13, 2020 21:54
@krusche krusche requested review from madwau and sascha11110 April 13, 2020 21:54
@filip-gregurevic
Copy link
Contributor

filip-gregurevic commented Apr 14, 2020

The expect statement used by chai seems to be the reason for a lot (almost all) of error unused expression, expected an assignment or function call (tslint:no-unused-expression) @typescript-eslint/tslint/config errors.
Since it is correct, there should be a workaround for it.
One possibility is to install this plugin https://www.npmjs.com/package/eslint-plugin-chai-friendly
Or the rule could be disabled for all test files like: https://stackoverflow.com/questions/37558795/nice-way-to-get-rid-of-no-unused-expressions-linter-error-with-chai
The third option is to write // eslint-disable-line no-unused-expressions after every use of expect.
In my opinion, the first way is the better one since the second option would also ignore real rule violations. (Or use the third one and copy-paste it everywhere)
@krusche

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@krusche krusche removed their assignment Apr 30, 2020
@sascha11110
Copy link
Contributor

List of all touched production files for testing on the test server:

src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.ts
src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts
src/main/webapp/app/admin/notification-management/notification-management-update.component.ts
src/main/webapp/app/admin/notification-management/notification-management.route.ts
src/main/webapp/app/admin/user-management/user-management-update.component.ts
src/main/webapp/app/admin/user-management/user-management.route.ts
src/main/webapp/app/app.main.ts
src/main/webapp/app/assessment/assessment-warning/assessment-warning.component.ts
src/main/webapp/app/complaints/complaints-for-tutor/complaints-for-tutor.component.ts
src/main/webapp/app/complaints/list-of-complaints/list-of-complaints.component.ts
src/main/webapp/app/core/auth/user-route-access-service.ts
src/main/webapp/app/core/config/uib-pagination.config.ts
src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts
src/main/webapp/app/core/interceptor/errorhandler.interceptor.ts
src/main/webapp/app/core/login/login.service.ts
src/main/webapp/app/core/websocket/websocket.service.ts
src/main/webapp/app/course/course-scores/course-scores.component.ts
src/main/webapp/app/course/manage/course-exercise-submission-result-simulation.service.ts
src/main/webapp/app/course/manage/course-group.component.ts
src/main/webapp/app/course/manage/course-management.route.ts
src/main/webapp/app/course/manage/course-management.service.ts
src/main/webapp/app/course/manage/course-update.component.ts
src/main/webapp/app/entities/lti-outcome-url.model.ts
src/main/webapp/app/entities/lti-user-id.model.ts
src/main/webapp/app/entities/single-user-notification.model.ts
src/main/webapp/app/exercises/file-upload/assess/file-upload-assessment-dashboard.component.ts
src/main/webapp/app/exercises/file-upload/assess/file-upload-assessment.component.html
src/main/webapp/app/exercises/file-upload/assess/file-upload-assessment.component.ts
src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-management.route.ts
src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-update.component.ts
src/main/webapp/app/exercises/file-upload/participate/file-upload-submission.service.ts
src/main/webapp/app/exercises/modeling/assess/modeling-assessment-editor/modeling-assessment-conflict.component.ts
src/main/webapp/app/exercises/modeling/assess/modeling-assessment-editor/modeling-assessment-dashboard.component.ts
src/main/webapp/app/exercises/modeling/assess/modeling-assessment-editor/modeling-assessment-editor.component.ts
src/main/webapp/app/exercises/modeling/assess/modeling-assessment.service.ts
src/main/webapp/app/exercises/modeling/manage/example-modeling/example-modeling-submission.component.ts
src/main/webapp/app/exercises/modeling/manage/modeling-exercise-update.component.ts
src/main/webapp/app/exercises/modeling/manage/modeling-exercise.route.ts
src/main/webapp/app/exercises/modeling/participate/modeling-submission.component.ts
src/main/webapp/app/exercises/modeling/participate/modeling-submission.service.ts
src/main/webapp/app/exercises/programming/assess/repo-export/programming-assessment-repo-export-dialog.component.ts
src/main/webapp/app/exercises/programming/manage/programming-exercise-management-routing.module.ts
src/main/webapp/app/exercises/programming/manage/programming-exercise.component.ts
src/main/webapp/app/exercises/programming/manage/test-cases/programming-exercise-manage-test-cases.component.ts
src/main/webapp/app/exercises/programming/manage/update/programming-exercise-test-schedule-date-picker.component.ts
src/main/webapp/app/exercises/programming/manage/update/programming-exercise-update.component.ts
src/main/webapp/app/exercises/programming/participate/code-editor-student-container.component.ts
src/main/webapp/app/exercises/programming/participate/programming-submission.service.ts
src/main/webapp/app/exercises/programming/shared/code-editor/layout/code-editor-grid.component.ts
src/main/webapp/app/exercises/programming/shared/instructions-render/extensions/programming-exercise-plant-uml.extension.ts
src/main/webapp/app/exercises/programming/shared/instructions-render/extensions/programming-exercise-task.extension.ts
src/main/webapp/app/exercises/programming/shared/instructions-render/service/programming-exercise-instruction.service.ts
src/main/webapp/app/exercises/quiz/manage/apollon-diagrams/apollon-diagram-create-form.component.ts
src/main/webapp/app/exercises/quiz/manage/apollon-diagrams/apollon-diagram-list.component.ts
src/main/webapp/app/exercises/quiz/manage/apollon-diagrams/exercise-generation/quiz-exercise-generator.ts
src/main/webapp/app/exercises/quiz/manage/quiz-exercise-detail.component.ts
src/main/webapp/app/exercises/quiz/manage/quiz-exercise-popup.service.ts
src/main/webapp/app/exercises/quiz/manage/quiz-exercise.service.ts
src/main/webapp/app/exercises/quiz/manage/re-evaluate/quiz-re-evaluate-warning.component.ts
src/main/webapp/app/exercises/quiz/manage/statistics/quiz-point-statistic/quiz-point-statistic.component.ts
src/main/webapp/app/exercises/quiz/participate/quiz-participation.component.ts
src/main/webapp/app/exercises/quiz/shared/questions/drag-and-drop-question/drag-and-drop-question.component.ts
src/main/webapp/app/exercises/shared/dashboards/tutor/tutor-exercise-dashboard.component.ts
src/main/webapp/app/exercises/shared/exercise-headers/difficulty-badge.component.ts
src/main/webapp/app/exercises/shared/exercise-headers/header-exercise-page-with-details.component.ts
src/main/webapp/app/exercises/shared/exercise-headers/header-participation-page.component.ts
src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint-update.component.ts
src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.component.ts
src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.route.ts
src/main/webapp/app/exercises/shared/exercise/exercise-popup.service.ts
src/main/webapp/app/exercises/shared/participation-submission/participation-submission-popup.service.ts
src/main/webapp/app/exercises/shared/participation/participation.service.ts
src/main/webapp/app/exercises/shared/result/result.service.ts
src/main/webapp/app/exercises/shared/structured-grading-criterion/grading-instructions-details/grading-instructions-details.component.ts
src/main/webapp/app/exercises/shared/team/team-exercise-search/team-exercise-search.component.ts
src/main/webapp/app/exercises/shared/team/team-owner-search/team-owner-search.component.ts
src/main/webapp/app/exercises/shared/team/team-student-search/team-student-search.component.ts
src/main/webapp/app/exercises/shared/team/team-update-dialog/team-delete-button.component.ts
src/main/webapp/app/exercises/shared/team/team.component.html
src/main/webapp/app/exercises/shared/team/team.component.ts
src/main/webapp/app/exercises/shared/team/teams.component.ts
src/main/webapp/app/exercises/text/assess-new/text-assessment-area/text-assessment-area.component.ts
src/main/webapp/app/exercises/text/assess-new/text-submission-assessment.component.ts
src/main/webapp/app/exercises/text/assess-new/text-submission-assessment.route.ts
src/main/webapp/app/exercises/text/assess-new/textblock-feedback-editor/textblock-feedback-editor.component.ts
src/main/webapp/app/exercises/text/manage/example-text-submission/example-text-submission.component.ts
src/main/webapp/app/exercises/text/manage/text-exercise/text-exercise-update.component.ts
src/main/webapp/app/exercises/text/manage/text-exercise/text-exercise.route.ts
src/main/webapp/app/exercises/text/participate/text-editor.component.ts
src/main/webapp/app/exercises/text/participate/text-submission.service.ts
src/main/webapp/app/guided-tour/guided-tour.component.ts
src/main/webapp/app/guided-tour/guided-tour.service.ts
src/main/webapp/app/guided-tour/tours/course-overview-tour.ts
src/main/webapp/app/home/home.component.ts
src/main/webapp/app/lecture/lecture-update.component.ts
src/main/webapp/app/lecture/lecture.route.ts
src/main/webapp/app/overview/course-lectures/course-lecture-row.component.html
src/main/webapp/app/overview/course-lectures/course-lecture-row.component.ts
src/main/webapp/app/overview/course-lectures/course-lectures.component.ts
src/main/webapp/app/overview/course-statistics/course-statistics.component.ts
src/main/webapp/app/overview/student-questions/student-question-row.component.ts
src/main/webapp/app/shared/category-selector/category-selector.component.ts
src/main/webapp/app/shared/components/confirm-autofocus-button.component.ts
src/main/webapp/app/shared/data-table/data-table.component.ts
src/main/webapp/app/shared/date-time-picker/date-time-picker.component.ts
src/main/webapp/app/shared/layouts/profiles/page-ribbon.component.ts
src/main/webapp/app/shared/markdown-editor/commands/fullscreen.command.ts
src/main/webapp/app/shared/markdown-editor/commands/katex.command.ts
src/main/webapp/app/shared/pipes/format-date.pipe.ts
src/main/webapp/app/shared/result/result-detail.component.ts
src/main/webapp/app/shared/util/security-util.ts

sleiss
sleiss previously approved these changes May 1, 2020
Copy link
Contributor

@sleiss sleiss left a comment

Choose a reason for hiding this comment

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

Checked the main parts of the production code and tested it on the test server, did not find any issues.

@kloessst
Copy link
Contributor

kloessst commented May 1, 2020

Went through the production files. Looks fine except some components like
code-editor-grid.component.ts, team-delete-button.component.ts, category-selector.component.ts use eslint-disable-next-line @typescript-eslint/no-unused-vars instead of deleting the unused variables. Any good reason for that?

Copy link
Contributor

@sascha11110 sascha11110 left a comment

Choose a reason for hiding this comment

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

@anditurdiu found a problem during the creation of system notifications. I fixed it in c1ca26f.

Thanks to @F4lka !

@madwau
Copy link
Contributor

madwau commented May 1, 2020

Looked through the production files and didn't spot any issues. Testing also went fine.

@krusche krusche merged commit cb7d306 into develop May 2, 2020
@krusche krusche deleted the chore/client-tests-codestyle-docs branch May 2, 2020 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) documentation tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.