-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(models): Filter update accumulator (#33018)
- Loading branch information
Showing
3 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; | ||
|
||
import { UpdaterImpl } from './updater'; | ||
|
||
test('updater typings', () => { | ||
|
@@ -15,6 +17,20 @@ test('updater typings', () => { | |
e: string[]; | ||
}>({} as any); | ||
|
||
const omnichannel = new UpdaterImpl<IOmnichannelRoom>({} as any); | ||
omnichannel.addToSet('v.activity', 'asd'); | ||
// @ts-expect-error | ||
Check warning on line 22 in packages/models/src/updater.spec.ts GitHub Actions / 🔎 Code Check / Code Lint
|
||
omnichannel.addToSet('v.activity', 1); | ||
// @ts-expect-error | ||
Check warning on line 24 in packages/models/src/updater.spec.ts GitHub Actions / 🔎 Code Check / Code Lint
|
||
omnichannel.addToSet('v.activity', { | ||
asdas: 1, | ||
}); | ||
|
||
// @ts-expect-error | ||
Check warning on line 29 in packages/models/src/updater.spec.ts GitHub Actions / 🔎 Code Check / Code Lint
|
||
omnichannel.addToSet('v.activity.asd', { | ||
asdas: 1, | ||
}); | ||
|
||
updater.addToSet('e', 'a'); | ||
|
||
// @ts-expect-error | ||
Check warning on line 36 in packages/models/src/updater.spec.ts GitHub Actions / 🔎 Code Check / Code Lint
|
||
|
@@ -160,7 +176,7 @@ test('it should add items to array', async () => { | |
{ | ||
_id: 'test', | ||
}, | ||
{ $addToSet: { $each: { a: ['b', 'c'] } } }, | ||
{ $addToSet: { a: { $each: ['b', 'c'] } } }, | ||
); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters