mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 02:25:56 +00:00
Merge commit '2705098aac192074d44dd227bcfa0f8fd19c6211'
Change-source: pulse-maintainer
This commit is contained in:
@@ -2083,7 +2083,9 @@ describe('settings architecture guardrails', () => {
|
||||
// organisation panel or a browser storage hint.
|
||||
describe('organisation principal shell boundary', () => {
|
||||
it('prefers authenticated identity with a nullish legacy fallback', () => {
|
||||
expect(settingsPanelRegistryContextSource).toContain('params.securityStatus()?.currentUsername ??');
|
||||
expect(settingsPanelRegistryContextSource).toContain(
|
||||
'params.securityStatus()?.currentUsername ??',
|
||||
);
|
||||
expect(settingsPanelRegistryContextSource).not.toContain('sessionStorage');
|
||||
for (const panel of ['Overview', 'Access', 'Sharing']) {
|
||||
expect(settingsPanelRegistryContextSource).toContain(
|
||||
|
||||
+12
-8
@@ -42,20 +42,24 @@ function buildParams(securityStatus: SecurityStatus | null): UseSettingsPanelReg
|
||||
|
||||
describe('buildSettingsPanelRegistryContext', () => {
|
||||
it('uses the authenticated principal rather than the configured administrator', () => {
|
||||
const context = buildSettingsPanelRegistryContext(buildParams({
|
||||
currentUsername: 'org-owner',
|
||||
authUsername: 'instance-admin',
|
||||
} as SecurityStatus));
|
||||
const context = buildSettingsPanelRegistryContext(
|
||||
buildParams({
|
||||
currentUsername: 'org-owner',
|
||||
authUsername: 'instance-admin',
|
||||
} as SecurityStatus),
|
||||
);
|
||||
expect(context.getOrganizationSharingPanelProps().currentUser).toBe('org-owner');
|
||||
expect(context.getOrganizationAccessPanelProps().currentUser).toBe('org-owner');
|
||||
expect(context.getOrganizationOverviewPanelProps().currentUser).toBe('org-owner');
|
||||
});
|
||||
|
||||
it('does not replace an explicitly empty principal with the configured admin', () => {
|
||||
const context = buildSettingsPanelRegistryContext(buildParams({
|
||||
currentUsername: '',
|
||||
authUsername: 'instance-admin',
|
||||
} as SecurityStatus));
|
||||
const context = buildSettingsPanelRegistryContext(
|
||||
buildParams({
|
||||
currentUsername: '',
|
||||
authUsername: 'instance-admin',
|
||||
} as SecurityStatus),
|
||||
);
|
||||
expect(context.getOrganizationSharingPanelProps().currentUser).toBe('');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user