first commit
Some checks failed
Deploy to Aliyun ACR / build-and-push (push) Has been cancelled

This commit is contained in:
jeremygan2021
2026-02-27 17:01:55 +08:00
commit 99218d9035
37 changed files with 15001 additions and 0 deletions

38
cypress/e2e/spec.cy.ts Normal file
View File

@@ -0,0 +1,38 @@
describe('WeChat Moments Generator', () => {
beforeEach(() => {
cy.visit('/');
});
it('should render the home page', () => {
cy.contains('朋友圈神器');
cy.get('input[placeholder*="名字"]').should('be.visible');
cy.contains('立即生成').should('be.visible');
});
it('should require name input', () => {
cy.contains('立即生成').click();
cy.contains('请输入姓名').should('be.visible');
});
// Mock API for full test
it('should generate copy (mocked)', () => {
cy.intercept('POST', '**/chat/completions', {
statusCode: 200,
body: {
choices: [{ message: { content: 'Mocked Result' } }]
}
}).as('generateAPI');
cy.get('input[placeholder*="名字"]').type('TestUser');
cy.contains('立即生成').click();
cy.wait('@generateAPI');
cy.contains('Mocked Result').should('be.visible');
});
it('should navigate to admin login', () => {
cy.contains('Admin Login').click();
cy.url().should('include', '/login');
cy.contains('管理员登录').should('be.visible');
});
});