mirror of
https://github.com/standardnotes/app.git
synced 2026-01-11 19:56:41 +00:00
fix(snjs): factory timeout to propagate subscription purchase
This commit is contained in:
parent
858fa6835c
commit
c40b17bd4c
3 changed files with 13 additions and 19 deletions
|
|
@ -52,7 +52,7 @@ describe('files', function () {
|
|||
billingFrequency: 12,
|
||||
payAmount: 59.00
|
||||
})
|
||||
await Factory.sleep(1)
|
||||
await Factory.sleep(2)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -65,6 +65,7 @@ describe('files', function () {
|
|||
await setup({ fakeCrypto: true, subscription: true })
|
||||
const remoteIdentifier = Utils.generateUuid()
|
||||
const token = await application.apiService.createFileValetToken(remoteIdentifier, 'write')
|
||||
console.log(token)
|
||||
|
||||
expect(token.length).to.be.above(0)
|
||||
})
|
||||
|
|
@ -97,7 +98,7 @@ describe('files', function () {
|
|||
payAmount: 59.00
|
||||
})
|
||||
|
||||
await Factory.sleep(1)
|
||||
await Factory.sleep(2)
|
||||
|
||||
const remoteIdentifier = Utils.generateUuid()
|
||||
const tokenOrError = await application.apiService.createFileValetToken(remoteIdentifier, 'write')
|
||||
|
|
@ -163,10 +164,4 @@ describe('files', function () {
|
|||
|
||||
expect(downloadError).to.be.ok
|
||||
})
|
||||
|
||||
it.skip('should cancel file download', async function () {
|
||||
await setup({ fakeCrypto: false, subscription: true })
|
||||
|
||||
// ...
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ chai.use(chaiAsPromised)
|
|||
const expect = chai.expect
|
||||
|
||||
describe('settings service', function () {
|
||||
this.timeout(Factory.TwentySecondTimeout)
|
||||
this.timeout(Factory.ThirtySecondTimeout)
|
||||
|
||||
const validSetting = SettingName.GoogleDriveBackupFrequency
|
||||
const fakePayload = 'Im so meta even this acronym'
|
||||
|
|
@ -13,21 +13,20 @@ describe('settings service', function () {
|
|||
|
||||
let application
|
||||
let context
|
||||
let user
|
||||
|
||||
beforeEach(async function () {
|
||||
localStorage.clear()
|
||||
context = await Factory.createAppContextWithFakeCrypto()
|
||||
|
||||
await context.launch()
|
||||
|
||||
application = context.application
|
||||
|
||||
const registerResponse = await Factory.registerUserToApplication({
|
||||
await Factory.registerUserToApplication({
|
||||
application: context.application,
|
||||
email: context.email,
|
||||
password: context.password,
|
||||
})
|
||||
user = registerResponse.user
|
||||
})
|
||||
|
||||
const reInitializeApplicationWithRealCrypto = async () => {
|
||||
|
|
@ -39,16 +38,16 @@ describe('settings service', function () {
|
|||
|
||||
application = context.application
|
||||
|
||||
const registerResponse = await Factory.registerUserToApplication({
|
||||
await Factory.registerUserToApplication({
|
||||
application: context.application,
|
||||
email: context.email,
|
||||
password: context.password,
|
||||
})
|
||||
user = registerResponse.user
|
||||
}
|
||||
|
||||
afterEach(async function () {
|
||||
await Factory.safeDeinit(application)
|
||||
localStorage.clear()
|
||||
})
|
||||
|
||||
it('creates and reads a setting', async function () {
|
||||
|
|
@ -133,7 +132,7 @@ describe('settings service', function () {
|
|||
payAmount: 59.00
|
||||
})
|
||||
|
||||
await Factory.sleep(1)
|
||||
await Factory.sleep(2)
|
||||
|
||||
const setting = await application.settings.getSubscriptionSetting('FILE_UPLOAD_BYTES_LIMIT')
|
||||
expect(setting).to.be.a('string')
|
||||
|
|
@ -157,7 +156,7 @@ describe('settings service', function () {
|
|||
billingFrequency: 12,
|
||||
payAmount: 59.00
|
||||
})
|
||||
await Factory.sleep(1)
|
||||
await Factory.sleep(2)
|
||||
|
||||
const response = await fetch('/packages/snjs/mocha/assets/small_file.md')
|
||||
const buffer = new Uint8Array(await response.arrayBuffer())
|
||||
|
|
@ -183,7 +182,7 @@ describe('settings service', function () {
|
|||
billingFrequency: 12,
|
||||
payAmount: 59.00
|
||||
})
|
||||
await Factory.sleep(1)
|
||||
await Factory.sleep(2)
|
||||
|
||||
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
|
||||
userEmail: context.email,
|
||||
|
|
@ -200,7 +199,7 @@ describe('settings service', function () {
|
|||
billingFrequency: 12,
|
||||
payAmount: 59.00
|
||||
})
|
||||
await Factory.sleep(1)
|
||||
await Factory.sleep(2)
|
||||
|
||||
const limitSettingAfter = await application.settings.getSubscriptionSetting('FILE_UPLOAD_BYTES_LIMIT')
|
||||
expect(limitSettingAfter).to.equal(limitSettingBefore)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ describe('subscriptions', function () {
|
|||
billingFrequency: 12,
|
||||
payAmount: 59.00
|
||||
})
|
||||
await Factory.sleep(0.25)
|
||||
await Factory.sleep(2)
|
||||
})
|
||||
|
||||
it('should invite a user by email to a shared subscription', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue