Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion routes/ai-home/stage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ function AISettingsPage() {
<>
<Stack align="center" gap="xs">
<ToggleControl
label={ __( 'Enable AI', 'ai' ) }
label={ __( 'AI features enabled', 'ai' ) }
checked={ globalEnabled }
onChange={ ( checked ) => {
void handleChange( {
Expand Down
26 changes: 24 additions & 2 deletions tests/e2e/specs/admin/settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ test.describe( 'Plugin settings', () => {
await disableExperiments( admin, page );

// Ensure global AI setting is disabled.
await expect( page.getByLabel( 'Enable AI' ) ).not.toBeChecked();
await expect(
page.getByLabel( 'AI features enabled' )
).not.toBeChecked();

// Ensure feature toggles are disabled when AI is disabled.
await expect(
Expand All @@ -119,7 +121,7 @@ test.describe( 'Plugin settings', () => {
await enableExperiments( admin, page );

// Ensure global AI setting is enabled.
await expect( page.getByLabel( 'Enable AI' ) ).toBeChecked();
await expect( page.getByLabel( 'AI features enabled' ) ).toBeChecked();

// Ensure we see the editor experiments section.
await expect(
Expand All @@ -132,6 +134,26 @@ test.describe( 'Plugin settings', () => {
).toBeVisible();
} );

test( 'Global AI toggle reads as a master switch, not an aggregate (#600)', async ( {
admin,
page,
} ) => {
await enableExperiments( admin, page );

// The control is labeled as a state ("AI features enabled"), not the
// imperative "Enable AI" that implied an aggregate/all-on meaning.
const masterToggle = page.getByLabel( 'AI features enabled' );
await expect( masterToggle ).toBeVisible();
await expect( masterToggle ).toBeChecked();

// Turning a single feature off must not change the master toggle: it is
// a master switch, not a summary of individual feature states. This is
// the regression guard for the misleading solid-on toggle (#600).
await disableExperiment( admin, page, 'Title Generation' );
await expect( masterToggle ).toBeChecked();
await expect( page.getByLabel( 'Title Generation' ) ).not.toBeChecked();
} );

test( 'Inline settings retain pending edits when another toggle auto-saves', async ( {
admin,
page,
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const disableExperiments = async ( admin: Admin, page: Page ) => {
await visitSettingsPage( admin );

// Wait for page to fully load before finding the global toggle.
const globalToggle = page.getByLabel( 'Enable AI' );
const globalToggle = page.getByLabel( 'AI features enabled' );
await expect( globalToggle ).toBeVisible( { timeout: 10000 } );
await expect( globalToggle ).toBeEnabled( { timeout: 10000 } );

Expand All @@ -190,7 +190,7 @@ export const enableExperiments = async ( admin: Admin, page: Page ) => {
await visitSettingsPage( admin );

// Wait for page to fully load before finding the global toggle.
const globalToggle = page.getByLabel( 'Enable AI' );
const globalToggle = page.getByLabel( 'AI features enabled' );
await expect( globalToggle ).toBeVisible( { timeout: 10000 } );
await expect( globalToggle ).toBeEnabled( { timeout: 10000 } );

Expand Down
Loading