-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(indexes): add search indexes sorting test; remove only; make su…
…re tab state hooks is better adapted for testing env
- Loading branch information
1 parent
d226814
commit 560d55f
Showing
4 changed files
with
183 additions
and
62 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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { SearchIndex } from 'mongodb-data-service'; | ||
import type { RegularIndex } from '../src/modules/regular-indexes'; | ||
|
||
export function mockRegularIndex(info: Partial<RegularIndex>): RegularIndex { | ||
return { | ||
ns: 'test.test', | ||
name: '_id_1', | ||
key: {}, | ||
fields: [], | ||
size: 0, | ||
relativeSize: 0, | ||
...info, | ||
extra: { | ||
...info.extra, | ||
}, | ||
}; | ||
} | ||
|
||
export function mockSearchIndex(info: Partial<SearchIndex>): SearchIndex { | ||
return { | ||
id: 'a', | ||
name: 'test', | ||
status: 'READY', | ||
queryable: true, | ||
...info, | ||
latestDefinition: { | ||
...info.latestDefinition, | ||
}, | ||
}; | ||
} |
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