Fix guest demo UX and enforce guest limits
This commit is contained in:
@@ -34,6 +34,24 @@ describe('classifyPackageChange', () => {
|
||||
const candidate = { ...active, id: 4, max_photos: 200, gallery_days: 10, features: { advanced_analytics: false } } as any;
|
||||
expect(classifyPackageChange(candidate, active)).toEqual({ isUpgrade: false, isDowngrade: true });
|
||||
});
|
||||
|
||||
it('treats unlimited sharing as an upgrade over limited sharing', () => {
|
||||
const starter = { ...active, id: 5, features: ['limited_sharing'], max_photos: 100 } as any;
|
||||
const standard = { ...active, id: 6, features: ['unlimited_sharing'], max_photos: 100 } as any;
|
||||
expect(classifyPackageChange(standard, starter)).toEqual({ isUpgrade: true, isDowngrade: false });
|
||||
});
|
||||
|
||||
it('treats watermark removal as an upgrade over base watermark', () => {
|
||||
const base = { ...active, id: 7, watermark_allowed: false, features: [] } as any;
|
||||
const removal = { ...active, id: 8, watermark_allowed: true, features: ['no_watermark'] } as any;
|
||||
expect(classifyPackageChange(removal, base)).toEqual({ isUpgrade: true, isDowngrade: false });
|
||||
});
|
||||
|
||||
it('keeps watermark custom as higher than watermark removal', () => {
|
||||
const custom = { ...active, id: 9, watermark_allowed: true, features: [] } as any;
|
||||
const removal = { ...active, id: 10, watermark_allowed: true, features: ['no_watermark'] } as any;
|
||||
expect(classifyPackageChange(removal, custom)).toEqual({ isUpgrade: false, isDowngrade: true });
|
||||
});
|
||||
});
|
||||
|
||||
describe('selectRecommendedPackageId', () => {
|
||||
|
||||
Reference in New Issue
Block a user