forked from 77media/video-flow
28 lines
752 B
TypeScript
28 lines
752 B
TypeScript
// Mock localStorage
|
|
global.localStorage = {
|
|
getItem: jest.fn(() => 'mock-token'),
|
|
setItem: jest.fn(),
|
|
removeItem: jest.fn(),
|
|
clear: jest.fn(),
|
|
length: 0,
|
|
key: jest.fn(),
|
|
};
|
|
|
|
// Mock BASE_URL
|
|
jest.mock('../../../api/constants', () => ({
|
|
BASE_URL: 'http://127.0.0.1:8000'
|
|
}));
|
|
|
|
import { ScriptEditUseCase } from "../usecase/ScriptEditUseCase";
|
|
|
|
describe('ScriptService 业务逻辑测试', () => {
|
|
|
|
// 创建新的剧本编辑用例
|
|
const newScriptEditUseCase = new ScriptEditUseCase('');
|
|
it("想法生成剧本", async () => {
|
|
const res = await newScriptEditUseCase.generateScript("我想拍一个关于爱情的故事",(content)=>{
|
|
console.log(content);
|
|
});
|
|
}, 300000); // 30秒超时
|
|
});
|