mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 19:24:53 -05:00
dd71c9924e
* Edited notification copy for user with affilation that ha commons account * edited translation key to have overleaf professional appear in bold and switched to using trans component * changed anchor tag to button and added additional check to ensure affiliation exists before accessing institution name * add tests for commons user confirmation notification * edit user email context test to facilitate test data changes * edit license in fake test data * edit test to check text of notification for non commons user GitOrigin-RevId: 6700ceaa066f099ce593283887fa81d72ad624b6
114 lines
2.9 KiB
TypeScript
114 lines
2.9 KiB
TypeScript
import { UserEmailData } from '../../../../../types/user-email'
|
|
import { Affiliation } from '../../../../../types/affiliation'
|
|
|
|
export const confirmedUserData: UserEmailData = {
|
|
confirmedAt: '2022-03-10T10:59:44.139Z',
|
|
email: 'bar@overleaf.com',
|
|
default: false,
|
|
}
|
|
|
|
export const unconfirmedUserData: UserEmailData = {
|
|
email: 'baz@overleaf.com',
|
|
default: false,
|
|
}
|
|
|
|
export const professionalUserData: UserEmailData & {
|
|
affiliation: Affiliation
|
|
} = {
|
|
affiliation: {
|
|
cachedConfirmedAt: null,
|
|
cachedEntitlement: null,
|
|
cachedLastDayToReconfirm: null,
|
|
cachedPastReconfirmDate: false,
|
|
cachedReconfirmedAt: null,
|
|
department: 'Art History',
|
|
institution: {
|
|
commonsAccount: false,
|
|
confirmed: true,
|
|
id: 1,
|
|
isUniversity: false,
|
|
maxConfirmationMonths: null,
|
|
name: 'Overleaf',
|
|
ssoEnabled: false,
|
|
ssoBeta: false,
|
|
},
|
|
inReconfirmNotificationPeriod: false,
|
|
inferred: false,
|
|
licence: 'pro_plus',
|
|
pastReconfirmDate: false,
|
|
portal: { slug: '', templates_count: 1 },
|
|
role: 'Reader',
|
|
},
|
|
confirmedAt: '2022-03-09T10:59:44.139Z',
|
|
email: 'foo@overleaf.com',
|
|
default: true,
|
|
}
|
|
|
|
export const unconfirmedCommonsUserData: UserEmailData & {
|
|
affiliation: Affiliation
|
|
} = {
|
|
affiliation: {
|
|
cachedConfirmedAt: null,
|
|
cachedEntitlement: null,
|
|
cachedLastDayToReconfirm: null,
|
|
cachedPastReconfirmDate: false,
|
|
cachedReconfirmedAt: null,
|
|
department: 'Art History',
|
|
institution: {
|
|
commonsAccount: true,
|
|
confirmed: true,
|
|
id: 1,
|
|
isUniversity: false,
|
|
maxConfirmationMonths: null,
|
|
name: 'Overleaf',
|
|
ssoEnabled: false,
|
|
ssoBeta: false,
|
|
},
|
|
inReconfirmNotificationPeriod: false,
|
|
inferred: false,
|
|
licence: 'free',
|
|
pastReconfirmDate: false,
|
|
portal: { slug: '', templates_count: 1 },
|
|
role: 'Reader',
|
|
},
|
|
email: 'qux@overleaf.com',
|
|
default: true,
|
|
}
|
|
|
|
export const ssoUserData: UserEmailData = {
|
|
affiliation: {
|
|
cachedConfirmedAt: '2022-02-03T11:46:28.249Z',
|
|
cachedEntitlement: null,
|
|
cachedLastDayToReconfirm: null,
|
|
cachedPastReconfirmDate: false,
|
|
cachedReconfirmedAt: null,
|
|
department: 'Art History',
|
|
institution: {
|
|
commonsAccount: true,
|
|
confirmed: true,
|
|
id: 2,
|
|
isUniversity: true,
|
|
maxConfirmationMonths: 12,
|
|
name: 'SSO University',
|
|
ssoEnabled: true,
|
|
ssoBeta: false,
|
|
},
|
|
inReconfirmNotificationPeriod: false,
|
|
inferred: false,
|
|
licence: 'pro_plus',
|
|
pastReconfirmDate: false,
|
|
portal: { slug: '', templates_count: 0 },
|
|
role: 'Prof',
|
|
},
|
|
confirmedAt: '2022-02-03T11:46:28.249Z',
|
|
email: 'sso-prof@sso-university.edu',
|
|
samlProviderId: 'sso-prof-saml-id',
|
|
default: false,
|
|
}
|
|
|
|
export const fakeUsersData = [
|
|
{ ...confirmedUserData },
|
|
{ ...unconfirmedUserData },
|
|
{ ...professionalUserData },
|
|
{ ...unconfirmedCommonsUserData },
|
|
]
|