Page MenuHomePhabricator

Unit test ext.popups.renderer.article.js (part 2 HARD)
Closed, DuplicatePublic

Description

Here's the hairiest parts to test:

Not tested:

  • article.createPopup
    • FIX: Function comment is insane
    • Operates on inputs and returns outputs, but relies on global state, so mocking/stubbing will be needed.
    • Basically a view render function. Pretty big, 60LOC
  • article.createThumbnail
    • 70 lines of various conditionals that determines if it should call one of the two methods below.
    • Hairy stuff, desperately needs tests, it's going to take work.
  • article.getOffset
    • 60 lines of conditionals coupled with global state.
    • Not sure how we would properly unit-test it. Hard work.
  • article.getClasses
    • 40 lines of conditionals composing CSS classes.
    • Should be tested, but it is not easily unit-testable/understandable as it is.
  • article.processPopup
    • 55 lines of conditionals manipulating the com depending on global state.
    • Should be tested, but it is not easily unit-testable/understandable as it is.

Event Timeline

Ooops, I did it again .... I'm putting it back to where I took it from.

bmansurov removed bmansurov as the assignee of this task.Apr 21 2016, 4:57 PM

@Jhernandez @bmansurov this task is going to need some updates. Not sure if it's still relevant?

ovasileva raised the priority of this task from Low to Normal.Feb 16 2017, 6:45 PM

I'm going to merge it with the previous one and make it a single task for now.