feat: implement AI styling foundation and billing scope rework
This commit is contained in:
@@ -2,6 +2,11 @@ import React from 'react';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
|
||||
const mockEventData = {
|
||||
token: 'token',
|
||||
event: { name: 'Demo Event', capabilities: { ai_styling: false } },
|
||||
};
|
||||
|
||||
vi.mock('react-router-dom', () => ({
|
||||
useParams: () => ({ photoId: '123' }),
|
||||
useNavigate: () => vi.fn(),
|
||||
@@ -36,8 +41,12 @@ vi.mock('../components/ShareSheet', () => ({
|
||||
default: () => <div>ShareSheet</div>,
|
||||
}));
|
||||
|
||||
vi.mock('../components/AiMagicEditSheet', () => ({
|
||||
default: () => <div>AiMagicEditSheet</div>,
|
||||
}));
|
||||
|
||||
vi.mock('../context/EventDataContext', () => ({
|
||||
useEventData: () => ({ token: 'token', event: { name: 'Demo Event' } }),
|
||||
useEventData: () => mockEventData,
|
||||
}));
|
||||
|
||||
vi.mock('../services/photosApi', () => ({
|
||||
@@ -66,9 +75,18 @@ import PhotoLightboxScreen from '../screens/PhotoLightboxScreen';
|
||||
|
||||
describe('PhotoLightboxScreen', () => {
|
||||
it('renders lightbox layout', async () => {
|
||||
mockEventData.event = { name: 'Demo Event', capabilities: { ai_styling: false } };
|
||||
render(<PhotoLightboxScreen />);
|
||||
|
||||
expect(await screen.findByText('Gallery')).toBeInTheDocument();
|
||||
expect(await screen.findByText('Like')).toBeInTheDocument();
|
||||
expect(screen.queryByLabelText('AI Magic Edit')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('keeps ai magic edit action hidden while rollout flag is disabled', async () => {
|
||||
mockEventData.event = { name: 'Demo Event', capabilities: { ai_styling: true } };
|
||||
render(<PhotoLightboxScreen />);
|
||||
|
||||
expect(screen.queryByLabelText('AI Magic Edit')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user