mirror of
https://github.com/n8n-io/n8n.git
synced 2024-09-11 13:15:28 +03:00
fix(editor): Make inputs in the filter component regular inputs by default (#8980)
This commit is contained in:
parent
ddc0f57116
commit
295b650fb8
@ -24,16 +24,8 @@ describe('If Node (filter component)', () => {
|
|||||||
|
|
||||||
// Add
|
// Add
|
||||||
ndv.actions.addFilterCondition(FILTER_PARAM_NAME);
|
ndv.actions.addFilterCondition(FILTER_PARAM_NAME);
|
||||||
ndv.getters
|
ndv.getters.filterConditionLeft(FILTER_PARAM_NAME, 0).find('input').type('first left');
|
||||||
.filterConditionLeft(FILTER_PARAM_NAME, 0)
|
ndv.getters.filterConditionLeft(FILTER_PARAM_NAME, 1).find('input').type('second left');
|
||||||
.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.actions.addFilterCondition(FILTER_PARAM_NAME);
|
||||||
ndv.getters.filterConditions(FILTER_PARAM_NAME).should('have.length', 3);
|
ndv.getters.filterConditions(FILTER_PARAM_NAME).should('have.length', 3);
|
||||||
|
|
||||||
@ -42,9 +34,8 @@ describe('If Node (filter component)', () => {
|
|||||||
ndv.getters.filterConditions(FILTER_PARAM_NAME).should('have.length', 2);
|
ndv.getters.filterConditions(FILTER_PARAM_NAME).should('have.length', 2);
|
||||||
ndv.getters
|
ndv.getters
|
||||||
.filterConditionLeft(FILTER_PARAM_NAME, 0)
|
.filterConditionLeft(FILTER_PARAM_NAME, 0)
|
||||||
.find('.cm-content')
|
.find('input')
|
||||||
.first()
|
.should('have.value', 'second left');
|
||||||
.should('have.text', 'second left');
|
|
||||||
ndv.actions.removeFilterCondition(FILTER_PARAM_NAME, 1);
|
ndv.actions.removeFilterCondition(FILTER_PARAM_NAME, 1);
|
||||||
ndv.getters.filterConditions(FILTER_PARAM_NAME).should('have.length', 1);
|
ndv.getters.filterConditions(FILTER_PARAM_NAME).should('have.length', 1);
|
||||||
});
|
});
|
||||||
|
@ -43,7 +43,7 @@ const ndvStore = useNDVStore();
|
|||||||
const { debounce } = useDebounce();
|
const { debounce } = useDebounce();
|
||||||
|
|
||||||
function createCondition(): FilterConditionValue {
|
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[]>(
|
const allowedCombinators = computed<FilterTypeCombinator[]>(
|
||||||
|
@ -43,14 +43,7 @@ describe('FilterConditions.vue', () => {
|
|||||||
expect(getByTestId('filter-conditions')).toBeInTheDocument();
|
expect(getByTestId('filter-conditions')).toBeInTheDocument();
|
||||||
expect(await findAllByTestId('filter-condition')).toHaveLength(1);
|
expect(await findAllByTestId('filter-condition')).toHaveLength(1);
|
||||||
expect(getByTestId('filter-condition-left')).toBeInTheDocument();
|
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-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
|
// Only visible when multiple conditions
|
||||||
expect(queryByTestId('filter-combinator-select')).not.toBeInTheDocument();
|
expect(queryByTestId('filter-combinator-select')).not.toBeInTheDocument();
|
||||||
|
Loading…
Reference in New Issue
Block a user