tutanota/test/tests/Suite.ts

230 lines
10 KiB
TypeScript
Raw Normal View History

2023-06-29 18:26:45 +02:00
import o from "@tutao/otest"
2023-06-29 18:26:45 +02:00
import "./misc/ListModelTest.js"
import "./misc/ListElementListModelTest.js"
import "./api/worker/facades/LoginFacadeTest.js"
import "./api/common/utils/LoggerTest.js"
import "./api/common/utils/BirthdayUtilsTest.js"
import "./api/worker/rest/EntityRestClientTest.js"
import "./api/worker/crypto/CryptoFacadeTest.js"
import "./api/worker/crypto/AsymmetricCryptoFacadeTest.js"
Support group key rotation (#6588) * Allow groups to have multiple key versions tutadb#1628 * Adapt to model changes * Fix CommonMailUtilsTest * Remove symEncBucketKey from SecureExternalRecipientKeyData * Remove deprecated types Also fix tests that relied on them as dummy types * Add userKeyVersion to RecoverCode * Remove clientKey Seems to be unused. * Remove CreateFolderService Unused. * Remove symEncSessionKey from DraftCreateData Unused. * Remove symEncShareBucketKey from MailBox Unused. * Add userKeyVersion to TutanotaProperties * Remove PasswordRetrievalService type The service itself had been long gone. * Remove userKeyVersion from CustomerAccountCreateData CreateMailGroupData * Fix customer account creation Set the key version that we actually need there: the *system* admin pub key version. The sender key version is not needed, because the system admin only has RSA keys. Also, this is a new customer, so that would be version zero anyway. * Fix resolving bucket key with group reference Get the right versions along the way. * Use current group key when encrypting instance session keys * Remove left-over key getting Also document a couple of current key usages * Pass group key providers to EntityClient instead of group key * Fix types and do not provide sender key version for rsa Fix resolveServiceSessionKey * Rename constant to avoid confusion There is another constant with the same name. * Use TutanotaModelV69 * Introduce client side mechanism to handle key rotation requests see tutadb 1771 * Do not export 128-bit key generator It is only needed for tests within the package. * Remove group key version when creating user area groups Plus some minor clarity improvements. * Fix version handling when updating drafts and sending to secure external * Remove versions when creating external users They are zero. * Fix changing the admin flag * Remove (almost) all local admin related code * Improve readability * Default to user key version zero when loading entropy * Decrypt current groupKey with correct userGroupKey version * Fix system application offline migrations * Fix tutanota application offline migrations * Improve offline migration functions * Use AesKey type * Minor improvements from review * Use AesKey type instead of Aes128Key where possible * Model update after rebase * Fix getting user group key Should never try to get from the cache like a normal group key. * Fix getting former group key Start ID was off-by-one. * Minor changes from review. We just checked all usages of all public methods of KeyLoaderFacade to make sure we're using the correct versions where we need them. * More minor changes from review. * Pass ownerKeyProvider instead of ownerKey when updating with the EntityClient * Pass ownerKeyProvider only when necessary * Document ownerKeyProvider parameter * Fix offline database migration * Fix unlocking the indexer data --------- Co-authored-by: vaf <vaf@tutao.de> Co-authored-by: bedhub <bedhub@users.noreply.github.com> Co-authored-by: bed <bed@tutao.de>
2024-04-17 10:34:33 +02:00
import "./api/worker/crypto/InstanceMapperTest.js"
import "./api/worker/crypto/OwnerEncSessionKeysUpdateQueueTest.js"
import "./api/worker/crypto/CompatibilityTest.js"
import "./api/common/error/RestErrorTest.js"
import "./api/common/error/TutanotaErrorTest.js"
import "./api/worker/rest/EntityRestCacheTest.js"
import "./api/worker/rest/EphemeralCacheStorageTest.js"
import "./api/worker/EventBusClientTest.js"
import "./api/worker/EventBusEventCoordinatorTest.js"
import "./api/worker/search/IndexerTest.js"
import "./api/worker/search/IndexerCoreTest.js"
import "./api/worker/search/ContactIndexerTest.js"
import "./api/worker/search/MailIndexerTest.js"
import "./api/worker/search/IndexUtilsTest.js"
import "./api/worker/search/SearchFacadeTest.js"
import "./api/worker/search/SuggestionFacadeTest.js"
import "./api/worker/search/SearchIndexEncodingTest.js"
import "./serviceworker/SwTest.js"
import "./api/worker/search/EventQueueTest.js"
import "./api/worker/facades/MailFacadeTest.js"
import "./api/worker/facades/GroupManagementFacadeTest.js"
import "./api/worker/facades/PQMessageTest.js"
import "./api/worker/facades/PQFacadeTest.js"
import "./api/worker/facades/CalendarFacadeTest.js"
import "./api/worker/facades/UserFacadeTest.js"
import "./api/worker/facades/PublicKeyProviderTest.js"
Support group key rotation (#6588) * Allow groups to have multiple key versions tutadb#1628 * Adapt to model changes * Fix CommonMailUtilsTest * Remove symEncBucketKey from SecureExternalRecipientKeyData * Remove deprecated types Also fix tests that relied on them as dummy types * Add userKeyVersion to RecoverCode * Remove clientKey Seems to be unused. * Remove CreateFolderService Unused. * Remove symEncSessionKey from DraftCreateData Unused. * Remove symEncShareBucketKey from MailBox Unused. * Add userKeyVersion to TutanotaProperties * Remove PasswordRetrievalService type The service itself had been long gone. * Remove userKeyVersion from CustomerAccountCreateData CreateMailGroupData * Fix customer account creation Set the key version that we actually need there: the *system* admin pub key version. The sender key version is not needed, because the system admin only has RSA keys. Also, this is a new customer, so that would be version zero anyway. * Fix resolving bucket key with group reference Get the right versions along the way. * Use current group key when encrypting instance session keys * Remove left-over key getting Also document a couple of current key usages * Pass group key providers to EntityClient instead of group key * Fix types and do not provide sender key version for rsa Fix resolveServiceSessionKey * Rename constant to avoid confusion There is another constant with the same name. * Use TutanotaModelV69 * Introduce client side mechanism to handle key rotation requests see tutadb 1771 * Do not export 128-bit key generator It is only needed for tests within the package. * Remove group key version when creating user area groups Plus some minor clarity improvements. * Fix version handling when updating drafts and sending to secure external * Remove versions when creating external users They are zero. * Fix changing the admin flag * Remove (almost) all local admin related code * Improve readability * Default to user key version zero when loading entropy * Decrypt current groupKey with correct userGroupKey version * Fix system application offline migrations * Fix tutanota application offline migrations * Improve offline migration functions * Use AesKey type * Minor improvements from review * Use AesKey type instead of Aes128Key where possible * Model update after rebase * Fix getting user group key Should never try to get from the cache like a normal group key. * Fix getting former group key Start ID was off-by-one. * Minor changes from review. We just checked all usages of all public methods of KeyLoaderFacade to make sure we're using the correct versions where we need them. * More minor changes from review. * Pass ownerKeyProvider instead of ownerKey when updating with the EntityClient * Pass ownerKeyProvider only when necessary * Document ownerKeyProvider parameter * Fix offline database migration * Fix unlocking the indexer data --------- Co-authored-by: vaf <vaf@tutao.de> Co-authored-by: bedhub <bedhub@users.noreply.github.com> Co-authored-by: bed <bed@tutao.de>
2024-04-17 10:34:33 +02:00
import "./api/worker/facades/KeyLoaderFacadeTest.js"
2025-02-10 13:15:28 +01:00
import "./api/worker/facades/KeyVerificationFacadeTest.js"
import "./api/worker/SuspensionHandlerTest.js"
import "./api/worker/facades/ConfigurationDbTest.js"
import "./api/worker/CompressionTest.js"
import "./api/common/utils/PlainTextSearchTest.js"
import "./api/common/utils/EntityUtilsTest.js"
import "./api/worker/rest/CborDateEncoderTest.js"
import "./api/worker/facades/BlobFacadeTest.js"
import "./api/worker/facades/BlobAccessTokenFacadeTest.js"
import "./api/worker/utils/SleepDetectorTest.js"
import "./api/worker/rest/ServiceExecutorTest.js"
import "./api/worker/rest/CacheStorageProxyTest.js"
import "./contacts/VCardExporterTest.js"
import "./contacts/VCardImporterTest.js"
import "./misc/ClientDetectorTest.js"
import "./misc/LanguageViewModelTest.js"
2023-06-05 20:52:30 +02:00
import "./api/common/utils/CommonFormatterTest.js"
import "./misc/FormatterTest.js"
import "./api/worker/UrlifierTest.js"
import "./misc/PasswordUtilsTest.js"
import "./misc/PasswordGeneratorTest.js"
import "./misc/PasswordModelTest.js"
import "./gui/animation/AnimationsTest.js"
import "./gui/ThemeControllerTest.js"
import "./api/main/EntropyCollectorTest.js"
import "./misc/HtmlSanitizerTest.js"
import "./mail/InboxRuleHandlerTest.js"
import "./mail/MailUtilsSignatureTest.js"
import "./api/common/mail/CommonMailUtilsTest.js"
import "./mail/MailModelTest.js"
import "./contacts/ContactUtilsTest.js"
import "./contacts/ContactMergeUtilsTest.js"
import "./calendar/CalendarModelTest.js"
import "./calendar/CalendarUtilsTest.js"
2024-02-01 10:42:50 +01:00
import "./calendar/CalendarInvitesTest.js"
import "./calendar/CalendarParserTest.js"
import "./calendar/CalendarImporterTest.js"
import "./calendar/AlarmSchedulerTest.js"
import "./calendar/CalendarAgendaViewTest.js"
import "./support/FaqModelTest.js"
import "./gui/base/WizardDialogNTest.js"
Rewrite calendar editor and calendar popup make updating calendar events delete the old uidIndex correctly when updating calendar events, we sometimes had events in the delete call that do not have the hashedUid set, causing us to be unable to delete the uid index entry. when re-creating the event, that leads to a db.exists error. make sure the event popup always has the current version of the event. now that edit operations are possible from the popup, we either need to close the popup after it calls the model factory to make sure it's only called once, or make sure the model factory always uses the last version of the event. we opted for the first option here to make sure repeated changes to the attendance are actually sent as a response. make contact resolution failure more controlled for external users previously, responding to an event from an external mailbox would try to resolve a contact for the response mail, fail, try to create a contact and fail again on an opaque assertNotNull. show partial editability banner when creating new event in shared calendar make it possible to add alarms to invites in private calendars don't make saving/sending invites and cancellations depend on user choice for own events updateExistingEvent() should call sendNotifications/saveEvent even when there are no update worthy changes or the user did not tick the sendUpdates checkbox because invites/cancellations must be sent in any case and sending updates has a separate check for sendUpdates also make the sendUpdates button on the popup use the same logic as the shortcut when clicked (ask confirmation) Co-authored-by: nig <nig@tutao.de>
2023-04-25 16:54:46 +02:00
import "./calendar/eventeditor/CalendarEventWhenModelTest.js"
import "./calendar/eventeditor/CalendarEventWhoModelTest.js"
import "./calendar/eventeditor/CalendarEventAlarmModelTest.js"
import "./calendar/eventeditor/CalendarEventModelTest.js"
import "./gui/ColorTest.js"
import "./mail/SendMailModelTest.js"
import "./misc/OutOfOfficeNotificationTest.js"
import "./subscription/PriceUtilsTest.js"
import "./subscription/SubscriptionUtilsTest.js"
import "./subscription/CreditCardViewModelTest.js"
import "./mail/TemplateSearchFilterTest.js"
import "./mail/KnowledgeBaseSearchFilterTest.js"
import "./api/worker/facades/MailExportTokenFacadeTest.js"
import "./mail/export/ExporterTest.js"
import "./mail/export/BundlerTest.js"
import "./api/common/utils/FileUtilsTest.js"
import "./gui/GuiUtilsTest.js"
import "./misc/ParserTest.js"
import "./misc/news/items/ReferralLinkNewsTest.js"
import "./settings/TemplateEditorModelTest.js"
2023-06-08 16:46:09 +02:00
import "./settings/mailaddress/MailAddressTableModelTest.js"
import "./settings/UserDataExportTest.js"
import "./settings/login/secondfactor/SecondFactorEditModelTest.js"
import "./misc/SchedulerTest.js"
import "./misc/parsing/MailAddressParserTest.js"
import "./misc/FormatValidatorTest.js"
import "./settings/whitelabel/CustomColorEditorTest.js"
import "./login/LoginViewModelTest.js"
import "./misc/credentials/CredentialsProviderTest.js"
import "./misc/DeviceConfigTest.js"
import "./calendar/EventDragHandlerTest.js"
import "./calendar/CalendarGuiUtilsTest.js"
import "./calendar/CalendarViewModelTest.js"
import "./calendar/eventeditor/CalendarNotificationModelTest.js"
import "./misc/webauthn/WebauthnClientTest.js"
import "./translations/TranslationKeysTest.js"
import "./misc/UsageTestModelTest.js"
2022-10-18 16:23:32 +02:00
import "./misc/NewsModelTest.js"
import "./file/FileControllerTest.js"
import "./api/worker/rest/CustomCacheHandlerTest.js"
import "./misc/RecipientsModelTest.js"
import "./api/worker/facades/MailAddressFacadeTest.js"
2022-12-19 16:38:14 +01:00
import "./mail/model/FolderSystemTest.js"
import "./mail/model/MailListModelTest.js"
import "./mail/model/ConversationListModelTest.js"
import "./gui/ScopedRouterTest.js"
import "./contacts/ContactListEditorTest.js"
import "./login/PostLoginUtilsTest.js"
import "./api/worker/facades/KyberFacadeTest.js"
import "./api/worker/facades/RsaPqPerformanceTest.js"
import "./api/worker/pdf/DeflaterTest.js"
import "./api/worker/pdf/PdfWriterTest.js"
import "./api/worker/pdf/PdfObjectTest.js"
import "./api/worker/pdf/PdfDocumentTest.js"
import "./api/worker/invoicegen/PdfInvoiceGeneratorTest.js"
import "./api/worker/invoicegen/XRechnungInvoiceGeneratorTest.js"
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
import "./subscription/SignupFormTest.js"
import "./api/worker/facades/ContactFacadeTest.js"
Support group key rotation (#6588) * Allow groups to have multiple key versions tutadb#1628 * Adapt to model changes * Fix CommonMailUtilsTest * Remove symEncBucketKey from SecureExternalRecipientKeyData * Remove deprecated types Also fix tests that relied on them as dummy types * Add userKeyVersion to RecoverCode * Remove clientKey Seems to be unused. * Remove CreateFolderService Unused. * Remove symEncSessionKey from DraftCreateData Unused. * Remove symEncShareBucketKey from MailBox Unused. * Add userKeyVersion to TutanotaProperties * Remove PasswordRetrievalService type The service itself had been long gone. * Remove userKeyVersion from CustomerAccountCreateData CreateMailGroupData * Fix customer account creation Set the key version that we actually need there: the *system* admin pub key version. The sender key version is not needed, because the system admin only has RSA keys. Also, this is a new customer, so that would be version zero anyway. * Fix resolving bucket key with group reference Get the right versions along the way. * Use current group key when encrypting instance session keys * Remove left-over key getting Also document a couple of current key usages * Pass group key providers to EntityClient instead of group key * Fix types and do not provide sender key version for rsa Fix resolveServiceSessionKey * Rename constant to avoid confusion There is another constant with the same name. * Use TutanotaModelV69 * Introduce client side mechanism to handle key rotation requests see tutadb 1771 * Do not export 128-bit key generator It is only needed for tests within the package. * Remove group key version when creating user area groups Plus some minor clarity improvements. * Fix version handling when updating drafts and sending to secure external * Remove versions when creating external users They are zero. * Fix changing the admin flag * Remove (almost) all local admin related code * Improve readability * Default to user key version zero when loading entropy * Decrypt current groupKey with correct userGroupKey version * Fix system application offline migrations * Fix tutanota application offline migrations * Improve offline migration functions * Use AesKey type * Minor improvements from review * Use AesKey type instead of Aes128Key where possible * Model update after rebase * Fix getting user group key Should never try to get from the cache like a normal group key. * Fix getting former group key Start ID was off-by-one. * Minor changes from review. We just checked all usages of all public methods of KeyLoaderFacade to make sure we're using the correct versions where we need them. * More minor changes from review. * Pass ownerKeyProvider instead of ownerKey when updating with the EntityClient * Pass ownerKeyProvider only when necessary * Document ownerKeyProvider parameter * Fix offline database migration * Fix unlocking the indexer data --------- Co-authored-by: vaf <vaf@tutao.de> Co-authored-by: bedhub <bedhub@users.noreply.github.com> Co-authored-by: bed <bed@tutao.de>
2024-04-17 10:34:33 +02:00
import "./api/worker/facades/KeyRotationFacadeTest.js"
import "./api/worker/facades/KeyAuthenticationFacadeTest.js"
import "./mail/view/ConversationViewModelTest.js"
import "./mail/view/MailViewModelTest.js"
import "./mail/view/MailViewerViewModelTest.js"
import "./api/worker/facades/KeyCacheTest.js"
import "./misc/InAppRatingUtilsTest.js"
import "./native/main/MailExportControllerTest.js"
import "./api/worker/facades/MailExportFacadeTest.js"
import "./api/worker/search/BulkMailLoaderTest.js"
import * as td from "testdouble"
2023-01-12 16:48:28 +01:00
import { random } from "@tutao/tutanota-crypto"
import { Mode } from "../../src/common/api/common/Env.js"
2023-06-29 18:26:45 +02:00
export async function run({ integration, filter }: { integration?: boolean; filter?: string } = {}) {
await setupSuite({ integration })
const result = await o.run({ filter })
2023-06-29 18:26:45 +02:00
o.printReport(result)
2023-06-29 18:26:45 +02:00
return result
}
2023-06-29 18:26:45 +02:00
async function setupSuite({ integration }: { integration?: boolean }) {
const { WorkerImpl } = await import("../../src/mail-app/workerUtils/worker/WorkerImpl.js")
globalThis.testWorker = WorkerImpl
if (typeof process != "undefined") {
2023-06-29 18:26:45 +02:00
if (integration) {
console.log("\nRunning with integration tests because was run with -i\n")
await import("./api/main/WorkerTest.js")
await import("./IntegrationTest.js")
} else {
console.log("\nRunning without integration tests because run without -i\n")
}
}
if (typeof process != "undefined") {
// setup the Entropy for all testcases
2023-01-12 16:48:28 +01:00
await random.addEntropy([{ data: 36, entropy: 256, source: "key" }])
await import("./desktop/PathUtilsTest.js")
await import("./desktop/files/TempFsTest.js")
await import("./desktop/config/migrations/DesktopConfigMigratorTest.js")
await import("./desktop/ElectronUpdaterTest.js")
await import("./desktop/DesktopNotifierTest.js")
await import("./desktop/ApplicationWindowTest.js")
await import("./desktop/sse/SecretStorageTest.js")
await import("./desktop/sse/DesktopAlarmStorageTest.js")
await import("./desktop/sse/DesktopAlarmSchedulerTest.js")
await import("./desktop/files/DesktopFileFacadeTest.js")
await import("./desktop/net/ProtocolProxyTest.js")
await import("./desktop/SocketeerTest.js")
await import("./desktop/integration/DesktopIntegratorTest.js")
await import("./desktop/integration/RegistryScriptGeneratorTest.js")
await import("./desktop/DesktopCryptoFacadeTest.js")
await import("./desktop/DesktopContextMenuTest.js")
2023-11-09 13:30:55 +01:00
await import("./desktop/DesktopKeyStoreFacadeTest.js")
2022-12-27 15:37:40 +01:00
await import("./desktop/config/ConfigFileTest.js")
await import("./desktop/db/OfflineDbFacadeTest.js")
await import("./desktop/credentials/DesktopNativeCredentialsFacadeTest.js")
await import("./desktop/credentials/AppPassHandlerTest.js")
2022-06-20 16:13:40 +02:00
await import("./api/worker/offline/OfflineStorageMigratorTest.js")
await import("./api/worker/offline/OfflineStorageMigrationsTest.js")
2022-06-20 16:13:40 +02:00
await import("./api/worker/offline/OfflineStorageTest.js")
await import("./desktop/config/DesktopConfigTest.js")
2023-07-26 18:06:29 +02:00
await import("./api/worker/rest/RestClientTest.js")
await import("./desktop/files/TempFsTest.js")
await import("./desktop/sse/SseClientTest.js")
await import("./desktop/sse/TutaSseFacadeTest.js")
await import("./desktop/sse/TutaNotificationHandlerTest.js")
await import("./desktop/credentials/KeychainEncryptionTest.js")
await import("./desktop/credentials/DesktopCredentialsStorageTest.js")
await import("./desktop/export/DesktopExportFacadeTest.js")
}
// testdouble complains about certain mocking related code smells, and also prints a warning whenever you replace a property on an object.
// it's very very noisy, so we turn it off
td.config({
2022-12-27 15:37:40 +01:00
ignoreWarnings: true,
})
o.before(async function () {
// setup the Entropy for all testcases
2023-01-12 16:48:28 +01:00
await random.addEntropy([{ data: 36, entropy: 256, source: "key" }])
})
o.afterEach(function () {
td.reset()
2023-06-29 18:26:45 +02:00
// Reset env.mode in case any tests have fiddled with it
env.mode = Mode.Test
})
}