1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-06 09:19:22 +02:00

Server: Add support for user flags

This commit is contained in:
Laurent Cozic
2021-08-22 11:28:15 +01:00
parent 2ae51acd29
commit 82b157b491
18 changed files with 414 additions and 82 deletions

View File

@@ -1,5 +1,5 @@
import { createUserAndSession, beforeAllDb, afterAllTests, beforeEachDb, models, checkThrowAsync, createItem } from '../utils/testing/testUtils';
import { EmailSender, User } from '../db';
import { EmailSender, User, UserFlagType } from '../db';
import { ErrorUnprocessableEntity } from '../utils/errors';
import { betaUserDateRange, stripeConfig } from '../utils/stripe';
import { AccountType } from './UserModel';
@@ -160,6 +160,9 @@ describe('UserModel', function() {
const reloadedUser = await models().user().load(user1.id);
expect(reloadedUser.can_upload).toBe(0);
const userFlag = await models().userFlag().byUserId(user1.id, UserFlagType.AccountWithoutSubscription);
expect(userFlag).toBeTruthy();
});
test('should disable upload and send an email if payment failed', async function() {