Commit Graph

10 Commits

Author SHA1 Message Date
Tom Alexander e7c05f597f
Add a test proving exists does not support parameters. 2020-05-30 14:42:34 -04:00
Tom Alexander eb0eb8d4ca
Add priority tests for the other block types except helpers since I do not yet have a helper implemented that sets a value. 2020-05-30 13:47:13 -04:00
Tom Alexander f04e84dc31
Attempted to move section over to the section-specific new breadcrumbs function.
I think the problem is, the index context needs to be a higher priority than the new context element, but when referencing data with `{.}` the new context element needs to take priority. I could either combine entries in the context tree so that variables like $idx and $len live side-by-side with real context elements, or try to implement a way to skip over index context elements when walking up the tree.
2020-05-25 23:28:49 -04:00
Tom Alexander 79f52ecdee
Add test for priorities while looping and split the new_breadcrumbs function into two separate new_breadcrumbs functions because sections and partials have different orderings. 2020-05-25 22:50:10 -04:00
Tom Alexander 0ca17e0885
Add tests that prove that the priority between explicit contexts and parameters varies across sections and partials. 2020-05-25 20:23:10 -04:00
Tom Alexander 400602124e
Added tests proving that the explicit context is evaluated using the global context of the partial containing the block (NOT the inline partial, which is where the explicit context is written). 2020-05-25 17:53:04 -04:00
Tom Alexander 4ce0899279
Expand the explicit context setting test to prove that injected_context gets inserted AFTER the current context when an explicit context is used. 2020-05-25 16:21:25 -04:00
Tom Alexander 4a21ae5af3
Add tests for explicit context setting that check failure conditions and implement a helper function to generate a new breadcrumb stack. 2020-05-25 15:40:42 -04:00
Tom Alexander 1152ff9974
Greatly expand the explicit_context_setting test.
Turns out explicit context setting works in a lot more places than the official dustjs pages indicate. Also some things don't make much sense (like setting it on a block works but not on an inline partial).
2020-05-24 18:16:16 -04:00
Tom Alexander e27ab16e06
Add a test for explicit context setting. 2020-05-24 17:19:34 -04:00