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

Add JavaScript unit tests and refactor #35

Merged
merged 65 commits into from
Feb 16, 2017

Commits on Jan 20, 2017

  1. Add initial basic test

    sirbrillig committed Jan 20, 2017
    Configuration menu
    Copy the full SHA
    20e2430 View commit details
    Browse the repository at this point in the history
  2. Alter extendWidgetControl to a (mostly) pure function

    Changes the function to accept an object, alter that object's prototype,
    and return it. The caller is then responsible for passing the
    constructor function to change.
    
    This allows the function to be more easily tested since it does not
    directly mutate global variables (although of course changing the
    prototype of a global variable will have a a global effect).
    
    Also adds `wp` and `_` as parameters to the IIFE to make their usage
    explicit.
    sirbrillig committed Jan 20, 2017
    Configuration menu
    Copy the full SHA
    d64c61f View commit details
    Browse the repository at this point in the history
  3. Add truthy test for isJsWidgetControl

    Not currently using real Controls, but it's something.
    sirbrillig committed Jan 20, 2017
    Configuration menu
    Copy the full SHA
    1fe1906 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e2dcb33 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2017

  1. Explicitly pass underscore to the IIFE

    IIFEs are good tools for encapsulating functionality and to maintain
    that encapsulation, all inputs and outputs (the exported API) need to be
    explicit. To simply alias variables, variable assignment is a less
    cumbersome tool.
    sirbrillig committed Jan 23, 2017
    Configuration menu
    Copy the full SHA
    26915f7 View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary use of _.clone

    `_.clone()` only performs a shallow copy and `_.extend()` is already
    doing that here.
    sirbrillig committed Jan 23, 2017
    Configuration menu
    Copy the full SHA
    8c34cfe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9cc5229 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2017

  1. Configuration menu
    Copy the full SHA
    739150e View commit details
    Browse the repository at this point in the history
  2. Add initial tests for Form

    sirbrillig committed Jan 31, 2017
    Configuration menu
    Copy the full SHA
    9e66457 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    99c9ae2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ba2700d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1d2ad13 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    187ac67 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e296998 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5d3e100 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c9cab13 View commit details
    Browse the repository at this point in the history
  10. Remove adding missing title property to model in sanitize

    This does not seem necessary.
    sirbrillig committed Jan 31, 2017
    Configuration menu
    Copy the full SHA
    ce79ba4 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3c99186 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    778bc95 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    f531a00 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    235cf1d View commit details
    Browse the repository at this point in the history
  15. Simplify Form constructor

    sirbrillig committed Jan 31, 2017
    Configuration menu
    Copy the full SHA
    b19fba3 View commit details
    Browse the repository at this point in the history
  16. Add Form.renderNotificationsToContainer to allow testing

    Debounced functions are async by nature and harder to test. This
    rewrites `renderNotifications` as a debounced proxy for
    `renderNotificationsToContainer`.
    sirbrillig committed Jan 31, 2017
    Configuration menu
    Copy the full SHA
    25b27ae View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    7f3d014 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    ff9ff09 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    4dc6349 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    ce7b650 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    19f752a View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    5976cc7 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    cad5b6a View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    cb7bf73 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    7be5641 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    1b08fdf View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    6361e7c View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2017

  1. Configuration menu
    Copy the full SHA
    5bbceca View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bafd1b9 View commit details
    Browse the repository at this point in the history
  3. Rename renderNotificationsTemplate to renderMarkupToContainer

    The previous helper had too many arguments
    sirbrillig committed Feb 2, 2017
    Configuration menu
    Copy the full SHA
    c0e778e View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2017

  1. Configuration menu
    Copy the full SHA
    0602b2f View commit details
    Browse the repository at this point in the history
  2. Explicitly pluck Form arguments when assigning

    Only allows `model` and `container`, ignoring all other properties.
    sirbrillig committed Feb 4, 2017
    Configuration menu
    Copy the full SHA
    6f707e1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b06d226 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c2e5a0d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ff48f63 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2017

  1. Move Form private functions to bottom of file

    It's easier to read the purpose of the file if the class comes first.
    sirbrillig committed Feb 6, 2017
    Configuration menu
    Copy the full SHA
    5255291 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2145662 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    379af12 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2017

  1. Change tests so that validate becomes a method on Form

    This replaces overriding the `model.validate` method by requiring using
    `form.setState()` to update the model
    sirbrillig committed Feb 10, 2017
    Configuration menu
    Copy the full SHA
    dae04c6 View commit details
    Browse the repository at this point in the history
  2. Move model.validate to Form.validate

    Form.validate is now called by Form.setState. This avoids mutating the model.
    sirbrillig committed Feb 10, 2017
    Configuration menu
    Copy the full SHA
    c63043c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8ba065a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    33ed378 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5f8f62b View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2017

  1. Configuration menu
    Copy the full SHA
    02b0a1c View commit details
    Browse the repository at this point in the history
  2. Modify createSyncedPropertyValue to use setState

    This makes sure that data from the DOM is validated before changing the
    model.
    sirbrillig committed Feb 11, 2017
    Configuration menu
    Copy the full SHA
    6bc2e66 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2017

  1. Remove fixed todo

    sirbrillig committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    4f5aa12 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a0cb61f View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2017

  1. Configuration menu
    Copy the full SHA
    067c045 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5d7ccb0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2688244 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e796fed View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    29af225 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2b495c9 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2017

  1. Configuration menu
    Copy the full SHA
    a1c9533 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    caa5b49 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a7f8d07 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5194115 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2017

  1. Update readme, bump version, add props

    [ci skip]
    westonruter committed Feb 16, 2017
    Configuration menu
    Copy the full SHA
    8562511 View commit details
    Browse the repository at this point in the history