1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-29 15:30:47 +00:00
TiddlyWiki5/editions/test/tiddlers/tests
Robin Munn e28af8d594
Checkbox widget: list and filter modes (#6561)
* Docs for CheckboxWidget list and filter modes

This documents the `listField` and `filter` attributes.

* Tests for checkbox widget list mode

* Implement checkbox list mode

* WIP on implementing filter attr for checkboxes

* Improve CheckboxWidget documentation

* Refactor checkbox tests: move function to top

The big findNodeOfType function belongs at the top of the describe
block, so that the checkbox tests are more compact and easy to read.

* Move checkbox widget tests to end of file

The checkbox widget tests are long and involved, so we'll move them to
the end of the file so they aren't a huge block of code you need to read
past to find the next test.

* Improve formatting of CheckboxWidget docs

The \define() calls that are short enough to fit on one line should be
put on one line, for readability. The ones that are quite long have been
kept on multiple lines, for readability.

* Added more passing tests for checkbox widget

* Add some failing tests for checkbox widget

The filter mode where neither checked nor unchecked is specified (in
which case an empty filter result means false and a non-empty result
means true) is not working yet.

* Make failing tests pass

* Uncomment (and improve) test for field mode

We're now ready to start working on making this test pass. (There was
also one small mistake in the test, which this commit corrects).

* All tests now passing

* No indeterminate checkboxes in simple modes

The simple checkbox modes (field and index) should not produce
indeterminate checkboxes. That should be reserved for the advanced modes
(list and filter).

* Minor improvement to unit tests

* Allow indeterminate checkboxes in list and filter modes

This change may require some tweaks to the unit tests to be able to test
it properly.

* Slightly easier to read tests

* Two more tests for list mode

* Greatly simplify unit test code

Turns out there's no need to jump through Object.getPrototypeOf hoops.

* Minor simplification of unit test

* Add tests for indeterminate in list & filter modes

With this, the set of tests is complete.

* More tests to specify list mode behavior

* Unfocus tests so all tests run

* Update docs to say "new in 5.2.3" insetad of 5.2.2

* Move checkbox widget tests into their own file

The test-widget.js file was getting too long with all the checkbox
tests added, so we'll move the checkbox tests into their own file.

* Add checkbox widget tests for index mode

This commit also adds tests for index list mode (with a listIndex
attribute that will parallel the listField attribute) but leaves them
commented out because they don't pass yet: the code that implements the
listIndex attribute hasn't been written yet).

* Add listIndex attribute to checkbox widget

* Remove code that lets checkboxes be indeterminate

This reverts commit 6afcb151be. We will
add this code back in a later PR.

* Remove indeterminate tests for checkbox widget

We're currently not allowing indeterminate checkboxes, so there's no
need for the tests that check for them.

* Document listIndex attribute of CheckboxWidget

* adds class tc-checkbox-checked when checked

* equivalent to #2182 (RadioWidget)
* also applies `tc-checkbox` to checkboxes by default, always

* Move macro definitions inside example text

Since the wikitext-example-without-html macro creates a new parsing
context, it's safe to have macro definitions inside it. That makes these
examples a lot easier to write, and to read.

* Remove all mention of indeterminate checkboxes

Also improve the documentation a little bit: mention what happens in
list mode if neither checked nor unchecked is specified.

* Move filter mode to bottom of checkbox docs

The `filter` attribute should be under both `listField` and `listIndex`
rather than being between them. The documentation for filter mode should
similarly be after the `listIndex` documentation.

* Improve docs for `class` attr of checkbox widget

This brings the wording of the `class` attribute more in line with how
it's worded in the RadioWidget docs.

* Fix bug with list tiddlers

If neither checked nor unchecked was specified, then the behavior should
be "empty = false, non-empty = true". But if *both* are specified yet
neither is found, then the checkbox should be unchecked (false). It had
been falling through to the "non-empty = true" behavior, which was wrong.

* Improve listIndex example of checkbox widgets

* Remove unused function from test-widget.js

Co-authored-by: Tobias Beer <beertobias@gmail.com>
2022-04-02 15:16:08 +01:00
..
data Trim Saga: Another batch of medium-sized files (#6270) 2022-03-26 15:19:04 +00:00
test-action-widgets.js Fix action-listops unsafe use of $tw.utils.stringifyList() (#6540) 2022-03-18 10:10:43 +00:00
test-backlinks.js Add backlinks indexer (#4421) 2020-03-26 13:15:02 +00:00
test-checkbox-widget.js Checkbox widget: list and filter modes (#6561) 2022-04-02 15:16:08 +01:00
test-compare-filter.js Add new compare filter operator 2020-04-13 10:03:01 +01:00
test-deserializers.js Add support for JSON-formatted tiddler store, and make it the default (#5708) 2021-07-14 09:15:30 +01:00
test-filters.js Make butlast[0] consistent with rest (#6483) 2022-02-26 09:42:24 +00:00
test-html-parser.js Allow newlines within filtered transclusions (#6421) 2022-02-21 15:28:21 +00:00
test-linked-list.js Memory efficient linked list (#5380) 2021-01-09 20:52:34 +00:00
test-parsetextreference.js Fixed bug introduced into transclusions for blank fields in #5736 (#5835) 2021-06-29 12:07:14 +01:00
test-prefixes-filter.js Fix for tag ordering issue #6382 (#6383) 2022-02-21 15:34:05 +00:00
test-tags.js Fix for tag ordering issue #6382 (#6383) 2022-02-21 15:34:05 +00:00
test-tiddler.js Add isEqual() method to tiddlers 2014-06-23 08:09:59 +01:00
test-utils.js Fix for tag ordering issue #6382 (#6383) 2022-02-21 15:34:05 +00:00
test-widget.js Add $let widget (#6148) 2021-10-30 11:42:22 +01:00
test-wikitext-parser.js Allow newlines within filtered transclusions (#6421) 2022-02-21 15:28:21 +00:00
test-wikitext-tabs-macro.js Update core tabs-macro to make it easier to extend for plugin authors. (#6578) 2022-03-31 15:41:19 +01:00
test-wikitext.js Don't set draggable property for links 2017-03-28 13:05:00 +01:00