Add tests for RB.UploadAttachmentView

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

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/


Description From Last Updated

issue requiring verification

guest4353guest4353

issue not requiring verification

guest4353guest4353

fix this then ship it

guest4353guest4353

asdaaa

guest6886guest6886

test of general comment

guest815guest815

ajajaajajaj

guest4842guest4842

this has a bug this comment made by yxiao

guest1254guest1254

this is a test yxiao

guest1254guest1254

delete this

guest1495guest1495

this a verification

guest5622guest5622

TESTS BBA

guest815guest815

hello

guest6886guest6886

Maybe this?

guest4842guest4842

A new comment.

guest4960guest4960

a defect must be slove

guest5935guest5935

Looks good!

guest7996guest7996

A response

guest4960guest4960

status: rejected reasoning: shitcode

guest1093guest1093
guest1495
guest9462
  1. dd

  2. dddddd

  3. \ffffffffffffffff

guest4353
  1. 
      
  2. issue requiring verification
  3. 
      
guest4353
  1. 
      
  2. issue not requiring verification
  3. 
      
guest4353
  1. ship it after that is fixed
  2. fix this then ship it
  3. 
      
guest520
guest8282
  1. Ship It!
  2. 
      
guest8282
  1. Ship It!
  2. 
      
guest7996
guest6886
  1. Ship It!
  2. 
      
guest6886
guest6886
guest2343
  1. Ship It!
  2. 
      
guest5622
  1. 
      
  2. this a verification

  3. 
      
guest815
  1. 
      
  2. test of general comment

  3. this is a footer

guest5935
  1. 
      
  2. reviewboard/staticbundles.py (Diff revision 1)
     
     

    a defect must be slove

  3. 
      
guest4960
  1. 
      
  2. reviewboard/staticbundles.py (Diff revision 1)
     
     

    A new comment.

  3. reviewboard/staticbundles.py (Diff revision 1)
     
     

    A response

  4. 
      
guest327
  1. Ship It!
  2. 
      
guest327
  1. Ship It!
  2. 
      
guest4842
  1. 
      
  2. reviewboard/static/rb/js/views/tests/uploadAttachmentViewTests.es6.js (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    Maybe this?

  3. 
      
guest4842
  1. 
      
  2. ajajaajajaj

  3. 
      
guest2063
  1. this is a test by bella

  2. 
      
guest1254
  1. 
      
  2. this has a bug
    this comment made by yxiao

  3. 
      
guest1254
  1. 
      
  2. this is a test
    yxiao

  3. 
      
guest1254
guest7021
  1. Ship It!
  2. 
      
guest1093
  1. 
      
  2. reviewboard/staticbundles.py (Diff revision 1)
     
     

    status: rejected
    reasoning: shitcode

  3. 
      
guest1093
  1. nonsense

  2. 
      
Loading...