mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 15:49:01 +02:00
Merge pull request #32816 from overleaf/jel-domain-captured-by-group
[web] Check `domainCapturedByGroup` on domain instead of `group.domainCaptureEnabled` only for project/dash redirect GitOrigin-RevId: a6389da9c943327e5941eaa24eb274106526f80b
This commit is contained in:
@@ -557,6 +557,27 @@ describe('ProjectListController', function () {
|
||||
await ctx.ProjectListController.projectListPage(ctx.req, ctx.res)
|
||||
})
|
||||
|
||||
it('should not redirect to domain capture page when no domain capture groups found', async function (ctx) {
|
||||
ctx.Features.hasFeature.withArgs('saas').returns(true)
|
||||
ctx.SplitTestHandler.promises.getAssignment
|
||||
.withArgs(ctx.req, ctx.res, 'domain-capture-redirect')
|
||||
.resolves({ variant: 'enabled' })
|
||||
ctx.Modules.promises.hooks.fire
|
||||
.withArgs('findDomainCaptureGroupsUserCouldBePartOf', ctx.user._id)
|
||||
.resolves([[]])
|
||||
let redirectCalled = false
|
||||
ctx.res.redirect = () => {
|
||||
redirectCalled = true
|
||||
}
|
||||
let redirectTo = ''
|
||||
ctx.res.render = (pageName, opts) => {
|
||||
redirectTo = pageName
|
||||
}
|
||||
await ctx.ProjectListController.projectListPage(ctx.req, ctx.res)
|
||||
expect(redirectCalled).to.be.false
|
||||
expect(redirectTo).to.equal('project/list-react')
|
||||
})
|
||||
|
||||
describe('when user linked to SSO', function () {
|
||||
const linkedEmail = 'picard@starfleet.com'
|
||||
const universityName = 'Starfleet'
|
||||
|
||||
Reference in New Issue
Block a user