Skip to content

Commit 27694d0

Browse files
authored
feat: test lint issue - add agentic cli preferences (MetaMask#8933) (MetaMask#9173)
## Explanation Follow-up to MetaMask#8933. The `does not mutate DEFAULT_AGENTIC_CLI_PREFERENCES when coercing legacy payloads` test in `@metamask/authenticated-user-storage` failed TypeScript and ESLint checks after `agenticCli` was added as an optional field on `NotificationPreferences`. The guard now checks `result?.agenticCli` instead of only `result`, so TypeScript narrows correctly before the test mutates `result.agenticCli.inAppNotificationsEnabled`. No runtime or API behavior changes. ## References * Follow-up to MetaMask#8933 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
1 parent 03b5c1e commit 27694d0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

packages/authenticated-user-storage/src/authenticated-user-storage.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,10 @@ describe('AuthenticatedUserStorageService', () => {
229229
const result = await service.getNotificationPreferences();
230230

231231
expect(result).not.toBeNull();
232-
if (!result) {
232+
if (!result?.agenticCli) {
233233
throw new Error('Result is null');
234234
}
235235
result.agenticCli.inAppNotificationsEnabled = false;
236-
237236
expect(DEFAULT_AGENTIC_CLI_PREFERENCES.inAppNotificationsEnabled).toBe(
238237
true,
239238
);

0 commit comments

Comments
 (0)