Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb committed Dec 11, 2024
1 parent f2c3869 commit 36b01f3
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion test/unit/forge/ee/lib/sso/index_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const setup = require('../../setup')
const FF_UTIL = require('flowforge-test-utils')
const { Roles } = FF_UTIL.require('forge/lib/roles')

describe('SSO Providers', function () {
describe.only('SSO Providers', function () {

Check failure on line 8 in test/unit/forge/ee/lib/sso/index_spec.js

View workflow job for this annotation

GitHub Actions / Postgres tests (18.x)

describe.only not permitted
let app

before(async function () {
Expand Down Expand Up @@ -365,5 +365,29 @@ d
})
;(await app.db.models.TeamMember.getTeamMembership(app.user.id, teams.ATeam.id)).should.have.property('role', Roles.Owner)
})
it('strip prefix and suffix from SAML groups', async function () {
// This should remove ownership from Alice in Team A

// Starting state:
// Alice owner ATeam

// Expected result:
// Alice owner ATeam - unchanged
await app.sso.updateTeamMembership({
'ff-roles': [
'test_ff-ateam-magician_err',
'test_ff-ateam-member_test',
'test_ff-bteam-owner_test',
'ff-ateam-admin_test'
]
}, app.user, {
groupAssertionName: 'ff-roles',
groupAllTeams: true,
groupPrefixLength: 5,
groupSuffixLength: 5
})
;(await app.db.models.TeamMember.getTeamMembership(app.user.id, teams.ATeam.id)).should.have.property('role', Roles.Member)
;(await app.db.models.TeamMember.getTeamMembership(app.user.id, teams.BTeam.id)).should.have.property('role', Roles.Owner)
})
})
})

0 comments on commit 36b01f3

Please sign in to comment.