1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-11 18:13:52 +02:00

Updated the filter condition for notContains (#4152)

This commit is contained in:
Rajat Dabade 2022-11-08 00:30:41 +05:30 committed by GitHub
parent 037e951141
commit f0342097c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -335,4 +335,17 @@ describe('src/cardFilter', () => {
expect(result[0]).toEqual(card1)
})
})
describe('verify applyFilter for title', () => {
test('should not return array with card1', () => {
const filterClauseNotContains = createFilterClause({propertyId: 'title', condition: 'notContains', values: ['card1']})
const filterGroup = createFilterGroup({
operation: 'and',
filters: [
filterClauseNotContains,
],
})
const result = CardFilter.applyFilterGroup(filterGroup, [], [card1])
expect(result.length).toEqual(0)
})
})
})

View File

@ -89,7 +89,7 @@ class CardFilter {
if (filter.values.length === 0) {
return true
}
return (value as string || '').includes(filter.values[0])
return !(value as string || '').includes(filter.values[0])
}
case 'startsWith': {
if (filter.values.length === 0) {