From 624b7de021702bfc85fab73895b67a94144a4cab Mon Sep 17 00:00:00 2001 From: Chris Jordan Date: Sun, 5 May 2024 09:34:11 -0400 Subject: [PATCH 1/2] Add inverted backlog filter to Chalk Planning work context Also remove clearing label calls for removing Unlabeled since it happens automatically now --- tests/dont_filter_edit_test.py | 6 +----- tests/label_filtering_test.py | 6 +----- tests/label_persistence_test.py | 6 +++--- ui/js/src/redux/workspaceSlice.ts | 1 + 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/dont_filter_edit_test.py b/tests/dont_filter_edit_test.py index 6d36c92c..4478065d 100644 --- a/tests/dont_filter_edit_test.py +++ b/tests/dont_filter_edit_test.py @@ -1,7 +1,6 @@ import pytest -from helpers.label_helpers import (clear_label_filters, toggle_label_filter, - toggle_label_filter_section) +from helpers.label_helpers import (toggle_label_filter, toggle_label_filter_section) from helpers.todo_helpers import (add_todo, cancel_edit, edit_todo, find_todo, find_todos, wait_for_todo, wait_for_todo_to_disappear) @@ -9,9 +8,6 @@ @pytest.mark.parametrize('test_name', ['Todo: Don\'t Filter During Edit']) def test_dont_filter_edit(page, todo_prefix): - # Remove default filter - clear_label_filters(page) - # Add todos todo1_description = f'{todo_prefix} todo to edit' add_todo(page, todo1_description) diff --git a/tests/label_filtering_test.py b/tests/label_filtering_test.py index a72d8a41..c2da580b 100644 --- a/tests/label_filtering_test.py +++ b/tests/label_filtering_test.py @@ -1,7 +1,6 @@ import pytest -from helpers.label_helpers import (add_todo_w_labels, clear_label_filters, - get_label_filter_status, toggle_label_filter, +from helpers.label_helpers import (add_todo_w_labels, get_label_filter_status, toggle_label_filter, toggle_label_filter_section) from helpers.todo_helpers import (list_todo_descriptions, wait_for_todo, wait_for_todo_to_disappear) @@ -9,9 +8,6 @@ @pytest.mark.parametrize('test_name', ['Label: Label Filtering']) def test_label_filtering(page, todo_prefix): - # Remove default filter - clear_label_filters(page) - # Add todos w/ labels todo_5min_low_desc = f'{todo_prefix} test todo - 5min low energy' add_todo_w_labels(page, todo_5min_low_desc, ['low-energy', '5 minutes']) diff --git a/tests/label_persistence_test.py b/tests/label_persistence_test.py index bb7a7596..8550e7f4 100644 --- a/tests/label_persistence_test.py +++ b/tests/label_persistence_test.py @@ -5,14 +5,14 @@ @pytest.mark.parametrize('test_name', ['Label: Label Persistence']) def test_label_persistence(page, todo_prefix): - # Remove default filter - clear_label_filters(page) - # Add todo w/ 5 min & errand labels todo_description = f'{todo_prefix} test todo' labels = ['errand', '5 minutes'] todo_item = add_todo_w_labels(page, todo_description, labels) + # Remove default filter + clear_label_filters(page) + # Verify labels are selected todo_labels = todo_item.locator('[data-testid="todo-labels"] > div').all_text_contents() assert todo_labels == labels diff --git a/ui/js/src/redux/workspaceSlice.ts b/ui/js/src/redux/workspaceSlice.ts index fc5e4bb5..edb40770 100644 --- a/ui/js/src/redux/workspaceSlice.ts +++ b/ui/js/src/redux/workspaceSlice.ts @@ -51,6 +51,7 @@ export const workContexts: { [key: string]: WorkContext } = { displayName: 'Chalk Planning', labels: { Chalk: FILTER_STATUS.Active, + backlog: FILTER_STATUS.Inverted, vague: FILTER_STATUS.Active, }, }, From c61043daff4d575894410e4ef8b822cc8c2f33fb Mon Sep 17 00:00:00 2001 From: Chris Jordan Date: Sun, 5 May 2024 10:04:13 -0400 Subject: [PATCH 2/2] Test fixes --- ui/js/src/selectors.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/js/src/selectors.test.ts b/ui/js/src/selectors.test.ts index b293743d..8e40e18d 100644 --- a/ui/js/src/selectors.test.ts +++ b/ui/js/src/selectors.test.ts @@ -265,6 +265,7 @@ describe('selectActiveWorkContext', function () { workspace: { filterLabels: { Chalk: FILTER_STATUS.Active, + backlog: FILTER_STATUS.Inverted, vague: FILTER_STATUS.Active, }, }, @@ -279,6 +280,7 @@ describe('selectActiveWorkContext', function () { workspace: { filterLabels: { Chalk: FILTER_STATUS.Active, + backlog: FILTER_STATUS.Inverted, vague: FILTER_STATUS.Active, Home: FILTER_STATUS.Active, }, @@ -294,6 +296,7 @@ describe('selectActiveWorkContext', function () { workspace: { filterLabels: { Chalk: FILTER_STATUS.Active, + backlog: FILTER_STATUS.Inverted, }, }, };