// Moved from feedback.test.ts with isScopeError itself: the labeler list now // asks the same question about a read that the feedback form asks about a // write. import { describe, expect, it } from 'vitest' import { isScopeError } from './scope' describe('isScopeError', () => { it('recognizes the PDS refusing a write the grant does not cover', () => { expect(isScopeError({ error: 'ScopeMissingError', message: 'Missing required scope' })).toBe( true, ) expect(isScopeError(new Error('Missing required scope "repo:app.userinput.discussion"'))).toBe( true, ) }) it('leaves every other failure alone', () => { expect(isScopeError(new Error('Failed to fetch'))).toBe(false) expect(isScopeError(undefined)).toBe(false) }) })