Commit Graph

1257 Commits

Author SHA1 Message Date
Dave Pearson
a14e469dd6 Improve OptionList test coverage (#2701)
* Cover the penultimate uncovered line in OptionList

Sort of moot, but worth a test that the control of a message is the option
list.

* Test OptionList hover over disabled option

I *would* have liked to have tested this sort of thing via snapshot tests,
but it seems that pilot.hover isn't quite behaving as desired there. But
this provides a useful test anyway.
2023-05-31 15:23:24 +01:00
Will McGugan
0849e6f410 mount order (#2702)
* mount order

* fix test

* simplify hooks

* changelog

* docstring
2023-05-31 15:16:26 +01:00
Dave Pearson
4ff1d18cb5 Merge pull request #2700 from davep/split-option-list-snapshits
Split up the OptionList snapshot tests
2023-05-31 11:22:51 +01:00
Dave Pearson
dba14b8a12 Split up the OptionList snapshot tests
Don't run 3 snapshot tests in one test function when it's easier to see what
broke and where if each is in their own function.
2023-05-31 09:17:26 +01:00
Will McGugan
149c39c86c Tooltips (#2670)
* inflect

* diagram

* tooltip render

* tooltip property

* add guard

* tooltip docs

* docs

* tidy, fix horizontal

* words, removed comment

* fix screenshot render

* simplify

* simfplify

* changelog

* simplify optimize

* inflect tests

* Apply suggestions from code review

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* docstring

* disable auto focus

* should be fraction

* optimization

* snapshot update

* Update tests/snapshot_tests/snapshot_apps/scroll_to_center.py

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-05-30 16:14:31 +01:00
Will McGugan
4930c1615b Merge branch 'main' into worker-coverage 2023-05-30 15:55:46 +01:00
Rodrigo Girão Serrão
ce771c19f4 Fix issue with switch screen. 2023-05-30 13:55:17 +01:00
Rodrigo Girão Serrão
5126e98b3b Remove weird import. 2023-05-30 10:21:35 +01:00
Rodrigo Girão Serrão
9569a98c77 Increase worker coverage and fix bug. 2023-05-29 19:49:58 +01:00
darrenburns
a40300a6f5 Ensure reflow reflows non-visible widgets, fix scroll_to_center issue (#2684) 2023-05-29 18:23:49 +01:00
darrenburns
3e7b2c53a8 Add Widget.remove_children method (#2657) 2023-05-29 18:03:42 +01:00
Rodrigo Girão Serrão
73d55725b5 Merge pull request #2604 from Textualize/input-auto-completion
Input completion suggestions
2023-05-29 14:48:40 +01:00
Will McGugan
ab10c7c326 fix zero division error (#2674)
* fix zero division error

* push tests
2023-05-28 14:56:05 +01:00
Rodrigo Girão Serrão
fd57309ad0 Make validators kwd-only. 2023-05-25 17:57:33 +01:00
Rodrigo Girão Serrão
31e2d1c839 Merge branch 'main' into input-auto-completion 2023-05-25 17:42:37 +01:00
Rodrigo Girão Serrão
fc86682dfa Add tests for suggester. 2023-05-25 17:32:26 +01:00
Dave Pearson
ea8c6039a9 Merge pull request #2652 from davep/multiselect 2023-05-25 17:10:20 +01:00
Dave Pearson
c16b32b52f Merge pull request #2656 from davep/private-validate-and-compute
Add (currently xfailing) tests for private reactive validation and compute methods
2023-05-25 15:53:24 +01:00
Dave Pearson
fa47d0bd41 Mark the public/private validate and compute tests as xfails 2023-05-25 15:27:27 +01:00
Dave Pearson
bd6717f3d5 Add a test for public and private computes
This fails for now.
2023-05-25 15:23:33 +01:00
Dave Pearson
400043dda1 Update snapshit tests 2023-05-25 14:47:11 +01:00
Dave Pearson
93c3c3652b Merge branch 'main' into multiselect 2023-05-25 13:59:34 +01:00
Dave Pearson
a944554d0d Finish a half-finished docstring 2023-05-25 13:58:31 +01:00
Will McGugan
3ab315beb6 Anim screenshot fix (#2655)
* fix screenshots in docs

* fix anim

* added wait for animation switch

* remove comment
2023-05-25 13:46:14 +01:00
darrenburns
62fcefbd2d Validation (#2600)
* A few different types of validation

* Rename

* Fix test

* Updating validation framework

* Update lockfile

* Ensure validators can be None

* Reworking the API a little

* Convert Input.Changed to dataclass

* Add utility for getting failures as strings

* Update an example in Validator docstring

* Remove some redundant `pass`es

* Renaming variables

* Validating Input on submit, attaching result to Submitted event

* Testing various validation features

* Update snapshots and deps

* Styling unfocused -invalid Input differently

* Add snapshot test around input validation and associated styles

* Validation docs

* Tidying validation docs in Input widget reference

* Fix mypy issues

* Remove __bool__ from Failure, make validator field required

* Code review changes

* Improving error messages in Validators
2023-05-25 13:29:33 +01:00
Dave Pearson
51f8d0dc9a Break up the SelectionList snapshit tests
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-05-25 13:20:22 +01:00
Dave Pearson
51133b3a62 Typo fix
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-05-25 13:19:18 +01:00
Rodrigo Girão Serrão
5cb30b5ecc Merge pull request #2628 from Textualize/auto-focus-improv
Add auto focus to app.
2023-05-25 11:59:54 +01:00
Dave Pearson
abda34aa13 Add a test for private validation
Currently failing.
2023-05-25 11:48:04 +01:00
Dave Pearson
939586f5f8 Add snapshot tests for the SelectionList examples 2023-05-25 11:06:21 +01:00
Dave Pearson
9a0e82f4c3 Merge branch 'main' into multiselect 2023-05-25 10:04:52 +01:00
Will McGugan
8151946f38 add blur (#2645)
* add blur

* docstring

* blur on disabled

* snapshot test

* Add test
2023-05-24 20:16:11 +01:00
Dave Pearson
71d7f7dd86 Merge branch 'main' into multiselect 2023-05-24 15:08:04 +01:00
Dave Pearson
cb05cfff53 Test that the control of selection list events is always correct 2023-05-24 10:21:40 +01:00
Dave Pearson
0a63748573 Add a test for later addition of selected selections 2023-05-24 10:16:25 +01:00
Dave Pearson
d3fe23f0bc Allow passing a Selection into a SelctionList
Up until now I've only been allowing tuples; mostly a hangover from the
initial take on this. Things have drifted a bit now and I feel it makes
sense to allow Selection instances in too.
2023-05-24 10:09:53 +01:00
Dave Pearson
2e540548f8 Add a test that removed selected selections are removed from selected 2023-05-24 09:19:56 +01:00
Dave Pearson
9d6e977e0e Test messages when toggling a selection via user input 2023-05-24 09:15:43 +01:00
Dave Pearson
56103c52e7 Ensure we log any OptionList messages in the messages test
We don't actually want to see them, we don't expect to see them, so here I
make a point of logging them so we can be sure we *don't* see them.
2023-05-24 09:09:40 +01:00
Dave Pearson
50d77b231f Add tests for the wrong sized tuple
While type checking picks this up, not everyone uses type checking.
2023-05-23 16:45:53 +01:00
Dave Pearson
9f6d35b871 Start unit tests for the actual selected property 2023-05-23 16:26:28 +01:00
Dave Pearson
c448fa1ea0 Add unit tests for selection list messages 2023-05-23 15:48:34 +01:00
Dave Pearson
f9780d0346 Add basic selection list creation unit tests 2023-05-23 15:13:46 +01:00
Rodrigo Girão Serrão
bc92cf57e7 Add auto focus to app.
Related issues: #2594.
2023-05-23 11:32:40 +01:00
Rodrigo Girão Serrão
297549c7d8 V2 of input suggestions API. 2023-05-23 10:47:22 +01:00
Rodrigo Girão Serrão
724fedc442 Merge pull request #2621 from Textualize/leave-footer-push-modal-screen
Leave footer when pushing modal screen
2023-05-22 14:43:05 +01:00
Rodrigo Girão Serrão
d48a127ffe Merge pull request #2540 from Textualize/screen-modes
Implements screen modes
2023-05-22 14:27:35 +01:00
Rodrigo Girão Serrão
c32d5d3c25 Add regression test for #2606. 2023-05-22 13:53:58 +01:00
Rodrigo Girão Serrão
6523fbaff1 Fix tests. 2023-05-18 16:27:09 +01:00
Rodrigo Girão Serrão
75606c8dfd Add explicit sleep. 2023-05-18 16:11:02 +01:00