Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): Make inputs in the filter component expressions by default #8784

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions cypress/e2e/30-if-node.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ describe('If Node (filter component)', () => {

// Add
ndv.actions.addFilterCondition(FILTER_PARAM_NAME);
ndv.getters.filterConditionLeft(FILTER_PARAM_NAME, 0).find('input').type('first left');
ndv.getters.filterConditionLeft(FILTER_PARAM_NAME, 1).find('input').type('second left');
ndv.getters
.filterConditionLeft(FILTER_PARAM_NAME, 0)
.find('.cm-content')
.first()
.type('first left');
ndv.getters
.filterConditionLeft(FILTER_PARAM_NAME, 1)
.find('.cm-content')
.first()
.type('second left');
ndv.actions.addFilterCondition(FILTER_PARAM_NAME);
ndv.getters.filterConditions(FILTER_PARAM_NAME).should('have.length', 3);

Expand All @@ -34,8 +42,9 @@ describe('If Node (filter component)', () => {
ndv.getters.filterConditions(FILTER_PARAM_NAME).should('have.length', 2);
ndv.getters
.filterConditionLeft(FILTER_PARAM_NAME, 0)
.find('input')
.should('have.value', 'second left');
.find('.cm-content')
.first()
.should('have.text', 'second left');
ndv.actions.removeFilterCondition(FILTER_PARAM_NAME, 1);
ndv.getters.filterConditions(FILTER_PARAM_NAME).should('have.length', 1);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const ndvStore = useNDVStore();
const { debounce } = useDebounce();

function createCondition(): FilterConditionValue {
return { id: uuid(), leftValue: '', rightValue: '', operator: DEFAULT_OPERATOR_VALUE };
return { id: uuid(), leftValue: '=', rightValue: '=', operator: DEFAULT_OPERATOR_VALUE };
}

const allowedCombinators = computed<FilterTypeCombinator[]>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ describe('FilterConditions.vue', () => {
expect(getByTestId('filter-conditions')).toBeInTheDocument();
expect(await findAllByTestId('filter-condition')).toHaveLength(1);
expect(getByTestId('filter-condition-left')).toBeInTheDocument();
expect(
within(getByTestId('filter-condition-left')).getByTestId('inline-expression-editor-input'),
).toBeInTheDocument();
expect(getByTestId('filter-operator-select')).toBeInTheDocument();
expect(getByTestId('filter-condition-right')).toBeInTheDocument();
expect(
within(getByTestId('filter-condition-right')).getByTestId('inline-expression-editor-input'),
).toBeInTheDocument();

// Only visible when multiple conditions
expect(queryByTestId('filter-combinator-select')).not.toBeInTheDocument();
Expand Down
Loading