Skip to content

Commit 74e68dd

Browse files
committed
test(oauth): pin the LinkedIn write-scope description
Nothing guarded the consent-screen text: utils.test.ts covered only the Bitbucket and Reddit overrides, and the modal test stubs getScopeDescription to identity, so a regression to a read-only label for a posting scope would pass silently.
1 parent d54bcee commit 74e68dd

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

apps/sim/lib/oauth/utils.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,28 @@ describe('getScopeDescription', () => {
398398
expect(getScopeDescription('account', 'reddit')).toBe('Update account preferences and settings')
399399
expect(getScopeDescription('account')).toBe('Update account preferences and settings')
400400
})
401+
402+
/**
403+
* The consent screen is where a user decides what to grant, so a write scope
404+
* has to read as one. `w_member_social` previously said 'Access LinkedIn
405+
* profile', describing a posting grant as a profile read.
406+
*
407+
* The wording tracks LinkedIn's own: "Post, comment, and like posts on behalf
408+
* of an authenticated member." It names all three verbs even though Sim only
409+
* posts -- the label describes the grant the token carries, not Sim's current
410+
* use of it, and LinkedIn's scopes cannot be sub-selected.
411+
*/
412+
it.concurrent('describes w_member_social as the write grant it is', () => {
413+
const description = getScopeDescription('w_member_social', 'linkedin')
414+
415+
expect(description).toBe('Post, comment, and like posts on your behalf')
416+
expect(description).not.toMatch(/access .*profile/i)
417+
})
418+
419+
it.concurrent('leaves the read-only LinkedIn scopes read-only', () => {
420+
expect(getScopeDescription('profile', 'linkedin')).toBe('Access profile information')
421+
expect(getScopeDescription('email', 'linkedin')).toBe('Access email address')
422+
})
401423
})
402424

403425
describe('parseProvider', () => {

0 commit comments

Comments
 (0)