Add tests for RB.UploadAttachmentView

Review Request #1911 — Created April 24, 2020 and updated — Latest diff uploaded

guest1495
Review Board
7f07631...
demo
This patch adds unit tests for `RB.UploadAttachmentView`. The recent
refactoring of the view led to some regressions that were not caught
until the changes were already landed. With unit tests, we can help
reduce the likelihood of this happening in the future.

Testing Done:
New tests:
- `Cancel` button has the correct state when the dialog is initialized.
- `Cancel` button closes the dialog when clicked.
- `Upload` button has the correct state when the dialog is initialized.
- `Upload` button has the correct state when a file is uploaded and when
  it is removed.
- `Upload` button sends request to create a file attachment when
  clicked.
- The dialog is populated with the right information when updating a
  file attachment.

Reviewed at https://reviews.reviewboard.org/r/10941/


Loading...