chore: add possibility to skip paid features in the e2e test suite
This commit is contained in:
@@ -62,7 +62,7 @@ describe('files', function () {
|
|||||||
localStorage.clear()
|
localStorage.clear()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should create valet token from server', async function () {
|
it('should create valet token from server - @paidfeature', async function () {
|
||||||
await setup({ fakeCrypto: true, subscription: true })
|
await setup({ fakeCrypto: true, subscription: true })
|
||||||
|
|
||||||
const remoteIdentifier = Utils.generateUuid()
|
const remoteIdentifier = Utils.generateUuid()
|
||||||
@@ -80,7 +80,7 @@ describe('files', function () {
|
|||||||
expect(tokenOrError.tag).to.equal('no-subscription')
|
expect(tokenOrError.tag).to.equal('no-subscription')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should not create valet token from server when user has an expired subscription', async function () {
|
it('should not create valet token from server when user has an expired subscription - @paidfeature', async function () {
|
||||||
await setup({ fakeCrypto: true, subscription: false })
|
await setup({ fakeCrypto: true, subscription: false })
|
||||||
|
|
||||||
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
|
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
|
||||||
@@ -107,7 +107,7 @@ describe('files', function () {
|
|||||||
expect(tokenOrError.tag).to.equal('expired-subscription')
|
expect(tokenOrError.tag).to.equal('expired-subscription')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('creating two upload sessions successively should succeed', async function () {
|
it('creating two upload sessions successively should succeed - @paidfeature', async function () {
|
||||||
await setup({ fakeCrypto: true, subscription: true })
|
await setup({ fakeCrypto: true, subscription: true })
|
||||||
|
|
||||||
const firstToken = await application.apiService.createFileValetToken(Utils.generateUuid(), 'write')
|
const firstToken = await application.apiService.createFileValetToken(Utils.generateUuid(), 'write')
|
||||||
@@ -121,7 +121,7 @@ describe('files', function () {
|
|||||||
expect(secondSession.uploadId).to.be.ok
|
expect(secondSession.uploadId).to.be.ok
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should encrypt and upload small file', async function () {
|
it('should encrypt and upload small file - @paidfeature', async function () {
|
||||||
await setup({ fakeCrypto: false, subscription: true })
|
await setup({ fakeCrypto: false, subscription: true })
|
||||||
|
|
||||||
const response = await fetch('/packages/snjs/mocha/assets/small_file.md')
|
const response = await fetch('/packages/snjs/mocha/assets/small_file.md')
|
||||||
@@ -134,7 +134,7 @@ describe('files', function () {
|
|||||||
expect(downloadedBytes).to.eql(buffer)
|
expect(downloadedBytes).to.eql(buffer)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should encrypt and upload big file', async function () {
|
it('should encrypt and upload big file - @paidfeature', async function () {
|
||||||
await setup({ fakeCrypto: false, subscription: true })
|
await setup({ fakeCrypto: false, subscription: true })
|
||||||
|
|
||||||
const response = await fetch('/packages/snjs/mocha/assets/two_mb_file.md')
|
const response = await fetch('/packages/snjs/mocha/assets/two_mb_file.md')
|
||||||
@@ -147,7 +147,7 @@ describe('files', function () {
|
|||||||
expect(downloadedBytes).to.eql(buffer)
|
expect(downloadedBytes).to.eql(buffer)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should delete file', async function () {
|
it('should delete file - @paidfeature', async function () {
|
||||||
await setup({ fakeCrypto: false, subscription: true })
|
await setup({ fakeCrypto: false, subscription: true })
|
||||||
|
|
||||||
const response = await fetch('/packages/snjs/mocha/assets/small_file.md')
|
const response = await fetch('/packages/snjs/mocha/assets/small_file.md')
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ describe('settings service', function () {
|
|||||||
expect(settings.getSettingValue(SettingName.create(SettingName.NAMES.MfaSecret).getValue())).to.not.be.ok
|
expect(settings.getSettingValue(SettingName.create(SettingName.NAMES.MfaSecret).getValue())).to.not.be.ok
|
||||||
})
|
})
|
||||||
|
|
||||||
it('reads a subscription setting', async () => {
|
it('reads a subscription setting - @paidfeature', async () => {
|
||||||
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
|
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
|
||||||
userEmail: context.email,
|
userEmail: context.email,
|
||||||
subscriptionId: subscriptionId++,
|
subscriptionId: subscriptionId++,
|
||||||
@@ -139,7 +139,7 @@ describe('settings service', function () {
|
|||||||
expect(setting).to.be.a('string')
|
expect(setting).to.be.a('string')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('persist irreplaceable subscription settings between subsequent subscriptions', async () => {
|
it('persist irreplaceable subscription settings between subsequent subscriptions - @paidfeature', async () => {
|
||||||
await reInitializeApplicationWithRealCrypto()
|
await reInitializeApplicationWithRealCrypto()
|
||||||
|
|
||||||
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
|
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ describe('subscriptions', function () {
|
|||||||
await Factory.sleep(2)
|
await Factory.sleep(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should invite a user by email to a shared subscription', async () => {
|
it('should invite a user by email to a shared subscription - @paidfeature', async () => {
|
||||||
await subscriptionManager.inviteToSubscription('test@test.te')
|
await subscriptionManager.inviteToSubscription('test@test.te')
|
||||||
|
|
||||||
const existingInvites = await subscriptionManager.listSubscriptionInvitations()
|
const existingInvites = await subscriptionManager.listSubscriptionInvitations()
|
||||||
@@ -59,7 +59,7 @@ describe('subscriptions', function () {
|
|||||||
expect(newlyCreatedInvite.status).to.equal('sent')
|
expect(newlyCreatedInvite.status).to.equal('sent')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should not invite a user by email if the limit of shared subscription is breached', async () => {
|
it('should not invite a user by email if the limit of shared subscription is breached - @paidfeature', async () => {
|
||||||
await subscriptionManager.inviteToSubscription('test1@test.te')
|
await subscriptionManager.inviteToSubscription('test1@test.te')
|
||||||
await subscriptionManager.inviteToSubscription('test2@test.te')
|
await subscriptionManager.inviteToSubscription('test2@test.te')
|
||||||
await subscriptionManager.inviteToSubscription('test3@test.te')
|
await subscriptionManager.inviteToSubscription('test3@test.te')
|
||||||
@@ -77,7 +77,7 @@ describe('subscriptions', function () {
|
|||||||
expect(existingInvites.length).to.equal(5)
|
expect(existingInvites.length).to.equal(5)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should cancel a user invitation to a shared subscription', async () => {
|
it('should cancel a user invitation to a shared subscription - @paidfeature', async () => {
|
||||||
await subscriptionManager.inviteToSubscription('test@test.te')
|
await subscriptionManager.inviteToSubscription('test@test.te')
|
||||||
await subscriptionManager.inviteToSubscription('test2@test.te')
|
await subscriptionManager.inviteToSubscription('test2@test.te')
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ describe('subscriptions', function () {
|
|||||||
expect(existingInvites.filter(invite => invite.status === 'canceled').length).to.equal(1)
|
expect(existingInvites.filter(invite => invite.status === 'canceled').length).to.equal(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should invite a user by email if the limit of shared subscription is restored', async () => {
|
it('should invite a user by email if the limit of shared subscription is restored - @paidfeature', async () => {
|
||||||
await subscriptionManager.inviteToSubscription('test1@test.te')
|
await subscriptionManager.inviteToSubscription('test1@test.te')
|
||||||
await subscriptionManager.inviteToSubscription('test2@test.te')
|
await subscriptionManager.inviteToSubscription('test2@test.te')
|
||||||
await subscriptionManager.inviteToSubscription('test3@test.te')
|
await subscriptionManager.inviteToSubscription('test3@test.te')
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
const syncServerHostName = urlParams.get('sync_server_host_name') ?? 'syncing-server-proxy';
|
const syncServerHostName = urlParams.get('sync_server_host_name') ?? 'syncing-server-proxy';
|
||||||
const bail = urlParams.get('bail') === 'false' ? false : true;
|
const bail = urlParams.get('bail') === 'false' ? false : true;
|
||||||
|
const skipPaidFeatures = urlParams.get('skip_paid_features') === 'true' ? true : false;
|
||||||
|
|
||||||
Object.assign(window, SNCrypto);
|
Object.assign(window, SNCrypto);
|
||||||
|
|
||||||
@@ -29,9 +30,14 @@
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
};
|
};
|
||||||
|
|
||||||
mocha.setup('bdd');
|
mocha.setup({
|
||||||
mocha.timeout(5000);
|
ui: 'bdd',
|
||||||
mocha.bail(bail);
|
timeout: 5000,
|
||||||
|
bail: bail,
|
||||||
|
});
|
||||||
|
if (skipPaidFeatures) {
|
||||||
|
mocha.grep('@paidfeature').invert();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module" src="memory.test.js"></script>
|
<script type="module" src="memory.test.js"></script>
|
||||||
<script type="module" src="protocol.test.js"></script>
|
<script type="module" src="protocol.test.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user