Skip to content

Commit

Permalink
chore: activate paid subscriptions for revisions e2e suites (#2693)
Browse files Browse the repository at this point in the history
  • Loading branch information
karolsojko authored Dec 12, 2023
1 parent 3d8746b commit db6151e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/snjs/mocha/history.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ describe('history manager', () => {

await context.launch()
await context.register()

/**
* Free user revisions are limited to 1 per day. This is to ensure that
* we don't hit that limit during testing.
*/
await context.activatePaidSubscriptionForUser()
})

afterEach(async function () {
Expand Down
16 changes: 16 additions & 0 deletions packages/snjs/mocha/vaults/revisions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ describe('shared vault revisions', function () {

await context.launch()
await context.register()

/**
* Free user revisions are limited to 1 per day. This is to ensure that
* we don't hit that limit during testing.
*/
await context.activatePaidSubscriptionForUser()
})

afterEach(async function () {
Expand All @@ -35,6 +41,8 @@ describe('shared vault revisions', function () {
await Collaboration.createSharedVaultWithAcceptedInviteAndNote(context)
deinitContactContextFunction = deinitContactContext

await contactContext.activatePaidSubscriptionForUser()

await Factory.sleep(Factory.ServerRevisionFrequency)

await context.changeNoteTitleAndSync(note, 'new title 1')
Expand Down Expand Up @@ -77,6 +85,8 @@ describe('shared vault revisions', function () {
await Collaboration.createSharedVaultWithAcceptedInviteAndNote(context)
deinitContactContextFunction = deinitContactContext

await contactContext.activatePaidSubscriptionForUser()

await Factory.sleep(Factory.ServerRevisionFrequency)

const contactNote = contactContext.items.findItem(note.uuid)
Expand All @@ -103,6 +113,8 @@ describe('shared vault revisions', function () {
await Collaboration.createSharedVaultWithAcceptedInviteAndNote(context)
deinitContactContextFunction = deinitContactContext

await contactContext.activatePaidSubscriptionForUser()

await Factory.sleep(Factory.ServerRevisionFrequency)
await context.changeNoteTitleAndSync(note, 'new title 1')

Expand Down Expand Up @@ -135,6 +147,8 @@ describe('shared vault revisions', function () {
await Collaboration.createSharedVaultWithAcceptedInviteAndNote(context)
deinitContactContextFunction = deinitContactContext

await contactContext.activatePaidSubscriptionForUser()

await Factory.sleep(Factory.ServerRevisionFrequency)

await context.changeNoteTitleAndSync(note, 'new title 1')
Expand Down Expand Up @@ -164,6 +178,8 @@ describe('shared vault revisions', function () {
await Collaboration.createSharedVaultWithAcceptedInviteAndNote(context)
deinitContactContextFunction = deinitContactContext

await contactContext.activatePaidSubscriptionForUser()

await Factory.sleep(Factory.ServerRevisionFrequency)

await context.changeNoteTitleAndSync(note, 'new title 1')
Expand Down

0 comments on commit db6151e

Please sign in to comment.