mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 07:39:02 +02:00
Merge pull request #17230 from overleaf/mf-tear-down-inr-2
[web] Tear down INR split test GitOrigin-RevId: 90c6ab4666d9281e804b279d697d6c14ffd682d2
This commit is contained in:
@@ -126,6 +126,14 @@ describe('ProjectListController', function () {
|
||||
getUserSubscription: sinon.stub().resolves({}),
|
||||
},
|
||||
}
|
||||
this.GeoIpLookup = {
|
||||
promises: {
|
||||
getCurrencyCode: sinon.stub().resolves({
|
||||
countryCode: 'US',
|
||||
currencyCode: 'USD',
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
this.ProjectListController = SandboxedModule.require(MODULE_PATH, {
|
||||
requires: {
|
||||
@@ -155,6 +163,7 @@ describe('ProjectListController', function () {
|
||||
this.UserPrimaryEmailCheckHandler,
|
||||
'../Notifications/NotificationsBuilder': this.NotificationBuilder,
|
||||
'../Subscription/SubscriptionLocator': this.SubscriptionLocator,
|
||||
'../../infrastructure/GeoIpLookup': this.GeoIpLookup,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -310,6 +319,38 @@ describe('ProjectListController', function () {
|
||||
this.ProjectListController.projectListPage(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should show INR Banner for Indian users with free account', function (done) {
|
||||
// usersBestSubscription is only available when saas feature is present
|
||||
this.Features.hasFeature.withArgs('saas').returns(true)
|
||||
this.SubscriptionViewModelBuilder.promises.getBestSubscription.resolves({
|
||||
type: 'free',
|
||||
})
|
||||
this.GeoIpLookup.promises.getCurrencyCode.resolves({
|
||||
countryCode: 'IN',
|
||||
})
|
||||
this.res.render = (pageName, opts) => {
|
||||
expect(opts.showInrGeoBanner).to.be.true
|
||||
done()
|
||||
}
|
||||
this.ProjectListController.projectListPage(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should not show INR Banner for Indian users with premium account', function (done) {
|
||||
// usersBestSubscription is only available when saas feature is present
|
||||
this.Features.hasFeature.withArgs('saas').returns(true)
|
||||
this.SubscriptionViewModelBuilder.promises.getBestSubscription.resolves({
|
||||
type: 'individual',
|
||||
})
|
||||
this.GeoIpLookup.promises.getCurrencyCode.resolves({
|
||||
countryCode: 'IN',
|
||||
})
|
||||
this.res.render = (pageName, opts) => {
|
||||
expect(opts.showInrGeoBanner).to.be.false
|
||||
done()
|
||||
}
|
||||
this.ProjectListController.projectListPage(this.req, this.res)
|
||||
})
|
||||
|
||||
describe('With Institution SSO feature', function () {
|
||||
beforeEach(function (done) {
|
||||
this.institutionEmail = 'test@overleaf.com'
|
||||
|
||||
Reference in New Issue
Block a user