@@ -31,8 +31,6 @@ function createMockAdapter(overrides = {}) {
|
||||
'SCRYING_POOL.PrivacyPanel.sectionDescription': 'Control which automation effects can affect your camera.',
|
||||
'SCRYING_POOL.PrivacyPanel.reactionCamLabel': 'Reaction Cam',
|
||||
'SCRYING_POOL.PrivacyPanel.reactionCamDescription': 'Automatically show your camera during key moments (combat, rolls, etc.)',
|
||||
'SCRYING_POOL.PrivacyPanel.hpReactiveCamStylingLabel': 'HP-Reactive Cam Styling',
|
||||
'SCRYING_POOL.PrivacyPanel.hpReactiveCamStylingDescription': 'Apply visual styling to your camera based on your character\'s HP',
|
||||
'SCRYING_POOL.PrivacyPanel.toggleOn': 'Enabled',
|
||||
'SCRYING_POOL.PrivacyPanel.toggleOff': 'Disabled',
|
||||
'SCRYING_POOL.PrivacyPanel.readOnlyNotice': 'This player\'s privacy settings are read-only',
|
||||
@@ -130,7 +128,6 @@ describe('PlayerPrivacyPanel', () => {
|
||||
it('should return context with settings', async () => {
|
||||
const settings = createPrivacySettings({
|
||||
reactionCamEnabled: true,
|
||||
hpReactiveCamStylingEnabled: false,
|
||||
});
|
||||
playerPrivacyManager.getSettings.mockReturnValue(settings);
|
||||
adapter.users.current.mockReturnValue({ id: targetUserId });
|
||||
@@ -140,7 +137,7 @@ describe('PlayerPrivacyPanel', () => {
|
||||
expect(context.title).toBe('Player Privacy Panel');
|
||||
expect(context.sectionHeader).toBe('Automation Opt-ins');
|
||||
expect(context.automationEffects).toBeDefined();
|
||||
expect(context.automationEffects).toHaveLength(2);
|
||||
expect(context.automationEffects).toHaveLength(1);
|
||||
expect(context.isReadOnly).toBe(false);
|
||||
expect(context.isOwnUser).toBe(true);
|
||||
});
|
||||
@@ -156,25 +153,22 @@ describe('PlayerPrivacyPanel', () => {
|
||||
expect(context.isOwnUser).toBe(false);
|
||||
});
|
||||
|
||||
it('should include both automation effects', async () => {
|
||||
it('should include the available automation effect', async () => {
|
||||
const context = await panel._prepareContext();
|
||||
|
||||
expect(context.automationEffects).toHaveLength(2);
|
||||
expect(context.automationEffects).toHaveLength(1);
|
||||
expect(context.automationEffects[0].key).toBe('reactionCam');
|
||||
expect(context.automationEffects[1].key).toBe('hpReactiveCamStyling');
|
||||
});
|
||||
|
||||
it('should reflect current settings in context', async () => {
|
||||
const settings = createPrivacySettings({
|
||||
reactionCamEnabled: true,
|
||||
hpReactiveCamStylingEnabled: true,
|
||||
});
|
||||
playerPrivacyManager.getSettings.mockReturnValue(settings);
|
||||
|
||||
const context = await panel._prepareContext();
|
||||
|
||||
expect(context.automationEffects[0].enabled).toBe(true);
|
||||
expect(context.automationEffects[1].enabled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -354,13 +348,11 @@ describe('PlayerPrivacyPanel', () => {
|
||||
it('should clear cached elements', () => {
|
||||
// Set up some cached values
|
||||
panel._reactionCamToggle = document.createElement('div');
|
||||
panel._hpReactiveCamToggle = document.createElement('div');
|
||||
panel._currentSettings = createPrivacySettings();
|
||||
|
||||
panel._onClose();
|
||||
|
||||
expect(panel._reactionCamToggle).toBe(null);
|
||||
expect(panel._hpReactiveCamToggle).toBe(null);
|
||||
expect(panel._currentSettings).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user