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

Required tests #5

Open
Matt-Esch opened this issue Apr 21, 2014 · 1 comment
Open

Required tests #5

Matt-Esch opened this issue Apr 21, 2014 · 1 comment

Comments

@Matt-Esch
Copy link
Collaborator

  • Initialisation tests
    • The thunk is initialised using the data that was passed
    • The initialised data can be null or undefined
    • The initialised data can be a value type (Number, String, Boolean)
    • The initialised data can be an object
    • The initialised data can be an array
    • The initialised data can be a function
    • Multiple arguments can be passed
  • Diff tests
    • Valid different values for identical types cause rerender
    • If the render functions are not identical, the node is rerendered (even if the underlying data is the same)
    • Identical null/undefined/value types result in noop
    • Identical object types result in noop
    • Shallow equal object types result in noop
    • Different permutations of data type cause rerender
      • undefined can replace null/value/object/array/function
      • null can replace undefined/value/object/array/function
      • value can replace undefined/null/object/array/function
      • object can replace undefined/null/value/array/function
      • array can replace undefined/null/value/object/function
      • function can replace undefined/null/value/object/array
    • A different number of arguments causes rerender
    • Consistent with 0 arguments results in noop
    • Objects with different prototypes are different
    • Extra keys on arrays are compared
  • Edge/Mutability tests
    • Shallow mutating the object/array used to initialise thunk does not affect the initialise data
    • Cached vnodes can be used by render
@Matt-Esch
Copy link
Collaborator Author

100% coverage in #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant