Merge pull request #35516 from overleaf/rh-cio-commons-ai

[web] Send Commons AI attribute to customer.io

GitOrigin-RevId: de010cc34f4e1a854a730ec39212845e1c05d4b1
This commit is contained in:
roo hutton
2026-09-17 11:28:57 +00:00
committed by Copybot
parent 8270641b42
commit 90ab683992
2 changed files with 48 additions and 1 deletions
@@ -123,6 +123,47 @@ describe('CustomerIoPlanHelpers', function () {
expect(properties.enterprise_commons).to.equal(false)
})
it('sets commons_ai=true when the user has active commons access at a writefullCommonsAccount institution', function () {
const properties = CustomerIoPlanHelpers.getAffiliationProperties([
{
emailHasInstitutionLicence: true,
affiliation: {
institution: { writefullCommonsAccount: true },
},
},
])
expect(properties.commons_ai).to.equal(true)
})
it('sets commons_ai=false when affiliated with a writefullCommonsAccount institution but without active commons access', function () {
const properties = CustomerIoPlanHelpers.getAffiliationProperties([
{
emailHasInstitutionLicence: false,
affiliation: {
institution: { writefullCommonsAccount: true },
},
},
])
expect(properties.commons_ai).to.equal(false)
})
it('sets commons_ai=false when active access is not at a writefullCommonsAccount institution', function () {
const properties = CustomerIoPlanHelpers.getAffiliationProperties([
{
emailHasInstitutionLicence: true,
affiliation: {
institution: { commonsAccount: true },
},
},
])
expect(properties.commons_ai).to.equal(false)
})
it('sets commons_ai=false when there are no emails', function () {
const properties = CustomerIoPlanHelpers.getAffiliationProperties([])
expect(properties.commons_ai).to.equal(false)
})
it('sets domain_capture=true when an affiliation has domain capture enabled', function () {
const properties = CustomerIoPlanHelpers.getAffiliationProperties([
{