Skip to content

Commit

Permalink
Add inverted backlog filter to Chalk Planning work context (#139)
Browse files Browse the repository at this point in the history
Also remove clearing label calls for removing Unlabeled since it happens automatically now
  • Loading branch information
wcjordan authored May 5, 2024
1 parent d8b1061 commit 6914fe7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
6 changes: 1 addition & 5 deletions tests/dont_filter_edit_test.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
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)


@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)
Expand Down
6 changes: 1 addition & 5 deletions tests/label_filtering_test.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
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)


@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'])
Expand Down
6 changes: 3 additions & 3 deletions tests/label_persistence_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions ui/js/src/redux/workspaceSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
Expand Down
3 changes: 3 additions & 0 deletions ui/js/src/selectors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ describe('selectActiveWorkContext', function () {
workspace: {
filterLabels: {
Chalk: FILTER_STATUS.Active,
backlog: FILTER_STATUS.Inverted,
vague: FILTER_STATUS.Active,
},
},
Expand All @@ -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,
},
Expand All @@ -294,6 +296,7 @@ describe('selectActiveWorkContext', function () {
workspace: {
filterLabels: {
Chalk: FILTER_STATUS.Active,
backlog: FILTER_STATUS.Inverted,
},
},
};
Expand Down

0 comments on commit 6914fe7

Please sign in to comment.