diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /comm/mailnews/import/test/unit/resources/AB_README | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'comm/mailnews/import/test/unit/resources/AB_README')
-rw-r--r-- | comm/mailnews/import/test/unit/resources/AB_README | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/comm/mailnews/import/test/unit/resources/AB_README b/comm/mailnews/import/test/unit/resources/AB_README new file mode 100644 index 0000000000..3cbeb09508 --- /dev/null +++ b/comm/mailnews/import/test/unit/resources/AB_README @@ -0,0 +1,39 @@ +To test importing an address book, make a new file in the +/import/test/unit directory with the prefix test_ in the filename +(ex. test_ldif_import.js). + +It should have a function named run_test with no parameters. If you are using +import_helper.js, which is already imported, you must at least get the file +to import and make a new AbImportHelper object with at least the file and type +of import. Call the beginImport method on the object when you are ready to +start the import. + +If you would like the results of the import checked, make sure to update +addressbook.json. This file is read by import_helper.js to compare the address +book cards imported to an array of "cards" in in this file. When making a new +import, first chose a name for the array (like basic_addressbook) to store the +cards that should be in the newly-imported address book. The properties and +values of each object in the array should identical to the properties and values +of the newly-imported card(s) and the cards themselves need to be in the +expected order. If a card to be imported does not have a property, do not +include it in the JSON card. Multiple types of imports can be tested with one +array, as only the supported attributes are checked. + +You will also need to give the AbImportHelper constructor two additional +parameters: the name the imported address book will have (the filename without +the extension) and the name you chose for the JSON object. + +Here is a sample LDIF unit test that doesn't check the results: +function run_test() +{ + var file = do_get_file("resources/basic_ldif_addressbook.ldif"); + new AbImportHelper(file, "Text file").beginImport(); +} + +Here is a sample CSV unit test that checks the results: +function run_test() +{ + var file = do_get_file("resources/basic_csv_addressbook.csv"); + new AbImportHelper(file, "Text file", "basic_csv_addressbook", + "basic_addressbook").beginImport(); +} |