mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 03:20:46 +02:00
Restructure frontend code to allow for extensions (#4721)
# Description of Changes Move frontend code into `core` folder and add infrastructure for `proprietary` folder to include premium, non-OSS features
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Test utilities for creating StirlingFile objects in tests
|
||||
*/
|
||||
|
||||
import { StirlingFile, createStirlingFile } from '@app/types/fileContext';
|
||||
|
||||
/**
|
||||
* Create a StirlingFile object for testing purposes
|
||||
*/
|
||||
export function createTestStirlingFile(
|
||||
name: string,
|
||||
content: string = 'test content',
|
||||
type: string = 'application/pdf'
|
||||
): StirlingFile {
|
||||
const file = new File([content], name, { type });
|
||||
return createStirlingFile(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create multiple StirlingFile objects for testing
|
||||
*/
|
||||
export function createTestFilesWithId(
|
||||
files: Array<{ name: string; content?: string; type?: string }>
|
||||
): StirlingFile[] {
|
||||
return files.map(({ name, content = 'test content', type = 'application/pdf' }) =>
|
||||
createTestStirlingFile(name, content, type)
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user