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

Server: Fixed calculation of max sizes for Postgres

This commit is contained in:
Laurent Cozic
2021-08-31 16:15:20 +01:00
parent 9c1dc7898a
commit 93a4ad09bb
3 changed files with 9 additions and 7 deletions

View File

@@ -210,13 +210,13 @@ describe('UserModel', function() {
await models().user().save({
id: user1.id,
account_type: AccountType.Basic,
total_item_size: accountByType(AccountType.Basic).max_total_item_size * 0.85,
total_item_size: Math.round(accountByType(AccountType.Basic).max_total_item_size * 0.85),
});
await models().user().save({
id: user2.id,
account_type: AccountType.Pro,
total_item_size: accountByType(AccountType.Pro).max_total_item_size * 0.2,
total_item_size: Math.round(accountByType(AccountType.Pro).max_total_item_size * 0.2),
});
const emailBeforeCount = (await models().email().all()).length;
@@ -242,7 +242,7 @@ describe('UserModel', function() {
await models().user().save({
id: user2.id,
total_item_size: accountByType(AccountType.Pro).max_total_item_size * 1.1,
total_item_size: Math.round(accountByType(AccountType.Pro).max_total_item_size * 1.1),
});
// User upload should be enabled at this point