Skip to content

Commit a9e8f30

Browse files
committed
fe/sr: empty string is not a named context
1 parent f0e7a5f commit a9e8f30

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/src/components/pages/schemas/schema-context-utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ describe('isNamedContext', () => {
175175
});
176176

177177
test('empty string is a named context', () => {
178-
expect(isNamedContext('')).toBe(true);
178+
expect(isNamedContext('')).toBe(false);
179179
});
180180
});
181181

frontend/src/components/pages/schemas/schema-context-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function deriveContexts(
112112
// True for actual SR contexts (not the synthetic
113113
// "All" or "Default" entries).
114114
export function isNamedContext(contextId: string): boolean {
115-
return contextId !== ALL_CONTEXT_ID && contextId !== DEFAULT_CONTEXT_ID;
115+
return contextId != '' && contextId !== ALL_CONTEXT_ID && contextId !== DEFAULT_CONTEXT_ID;
116116
}
117117

118118
// Convert a raw context name (e.g. from a URL param or parseSubjectContext)

0 commit comments

Comments
 (0)