mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-27 04:07:05 +00:00
test: clean code output quota assertions
This commit is contained in:
parent
4a51716951
commit
55a6075aa9
2 changed files with 5 additions and 3 deletions
|
|
@ -88,8 +88,7 @@ const removeCacheBuster = (filepath) =>
|
|||
typeof filepath === 'string' ? filepath.replace(/\?v=\d+$/, '') : filepath;
|
||||
|
||||
const getStorageFileId = (fileId, isUpdate) => (isUpdate ? `${fileId}-${v4()}` : fileId);
|
||||
const getStorageLimitOptions = (fileId, isUpdate) =>
|
||||
isUpdate ? { excludeFileId: fileId } : undefined;
|
||||
const getStorageLimitOptions = (fileId, isUpdate) => (isUpdate ? { excludeFileId: fileId } : {});
|
||||
|
||||
const cleanupReplacedCodeFile = async (req, previousFile, nextFile) => {
|
||||
const previousPath = removeCacheBuster(previousFile?.filepath);
|
||||
|
|
|
|||
|
|
@ -333,12 +333,15 @@ describe('Code Process', () => {
|
|||
const { file: result } = await processCodeOutput(imageParams);
|
||||
|
||||
expect(result.bytes).toBe(convertedBytes);
|
||||
expect(assertFileStorageLimit).toHaveBeenCalledTimes(1);
|
||||
expect(assertFileStorageLimit).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
incomingBytes: convertedBytes,
|
||||
}),
|
||||
);
|
||||
expect(assertFileStorageLimit.mock.calls[0][0]).not.toHaveProperty('excludeFileId');
|
||||
expect(assertFileStorageLimit).toHaveBeenCalledWith(
|
||||
expect.not.objectContaining({ excludeFileId: expect.anything() }),
|
||||
);
|
||||
expect(createFile).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue