Fix up a few other broken js-tests.

Review Request #14444 — Created May 19, 2025 and submitted — Latest diff uploaded

Information

Review Board
release-7.1.x

Reviewers

This change fixes a bunch of broken js-tests, but it came down to three
problems:

  • The FileAttachmentThumbnailView was checking the newly-added
    canAccessReviewUI attribute, but that wasn't set in the test that
    needed it. While I was doing this I fixed up the type in the
    attributes definition.
  • The check for the tab_size field was assuming that we had a file
    set on the reviewable, which many unit tests did not do. I've changed
    the implementation to check for that instead of assuming.
  • Similarly, the check to allow self ship-it was assuming that there was
    a "submitter" link present on the review request, when many unit tests
    did not set that data. I've changed it to check existence first.

Ran js-tests.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Fix up a few other broken js-tests.
This change fixes a bunch of broken js-tests, but it came down to three problems: - The `FileAttachmentThumbnailView` was checking the newly-added `canAccessReviewUI` attribute, but that wasn't set in the test that needed it. While I was doing this I fixed up the type in the attributes definition. - The check for the `tab_size` field was assuming that we had a `file` set on the reviewable, which many unit tests did not do. I've changed the implementation to check for that instead of assuming. - Similarly, the check to allow self ship-it was assuming that there was a "submitter" link present on the review request, when many unit tests did not set that data. I've changed it to check existence first. Testing Done: Ran js-tests.
dab3a48dc3c98689180dc06cd5d44085aa880cd6 David Trowbridge
reviewboard/static/rb/js/common/resources/models/fileAttachmentModel.ts
reviewboard/static/rb/js/reviews/views/diffReviewableView.ts
reviewboard/static/rb/js/reviews/views/reviewDialogView.ts
reviewboard/static/rb/js/reviews/views/tests/fileAttachmentThumbnailViewTests.ts
Loading...