Commit graph

45 commits

Author SHA1 Message Date
Dan Stillman
2b8a5ba0b7 Disable extension signing check for test runs 2015-10-26 05:00:38 -04:00
Aurimas Vinckevicius
711b823552 Add tests for itemFromCSLJSON and make sure data round-trips 2015-08-04 15:22:35 -05:00
Aurimas Vinckevicius
bb15336fdb Fix season export in CSL JSON 2015-08-04 14:19:39 -05:00
Aurimas Vinckevicius
1cbd7f71cf Parse author names in itemToCSLJSON 2015-07-27 18:37:45 -05:00
Dan Stillman
f07fe7184d Ignore trailing period in domain for Quick Copy
From @aurimasv
2015-07-03 23:46:39 -04:00
Dan Stillman
899e33c993 Add a test to make sure HTTPS URLs aren't failing for Quick Copy 2015-07-03 22:14:08 -04:00
Dan Stillman
242581a270 Fix Quick Copy in tab mode, but for real 2015-07-03 22:06:12 -04:00
Aurimas Vinckevicius
5334a09ee0 Fix institutional author export to CiteProcJS 2015-06-29 23:22:09 -05:00
Aurimas Vinckevicius
e3ab3ab03e Add institutional author to sample test data 2015-06-29 23:22:09 -05:00
Dan Stillman
3a5854f49f Update versions and submodules 2015-06-26 02:40:18 -04:00
Simon Kornblith
ca0af1abd6 Missed a UTC adjustment in 673168ea7b 2015-05-31 17:13:32 -04:00
Dan Stillman
8ff108cbdf Merge pull request #745 from Juris-M/simpler-stable-stringify
Simplification of stableStringify()
2015-05-31 17:10:42 -04:00
Simon Kornblith
673168ea7b Don't adjust accessDate for UTC and set version to 0 in Item#toJSON
Ref discussions:
https://github.com/zotero/zotero/pull/746/files#r31394225
https://github.com/zotero/zotero/pull/746#commitcomment-11445605
2015-05-31 17:02:20 -04:00
Frank Bennett
ff1d4fa602 Simplification of stableStringify() 2015-05-31 19:46:11 +09:00
Aurimas Vinckevicius
920969bb29 Add journalArticle JSON data for lighter testing 2015-05-26 16:11:45 -05:00
Aurimas Vinckevicius
daa92cb6ed Add auto-generated sample data
allTypesAndFields: Direct serialization of all valid fields for all valid item types
citeProcJSExport: All item types and fields as sent to citeproc-js
itemJSON: Zotero.Item::toJSON serialization of all item types and fields
translatorExport: items as presented to export translators after 4.0.27
translatorExportLegacy: items as presented to export translators before 4.0.27

(does not cover relations, collections, tags, attachments)
2015-05-26 16:11:44 -05:00
Aurimas Vinckevicius
ec786bf15c For now, use Zotero item DB ids when passing items to citeproc
citeproc-js relies on this in several locations. Seems that Zotero passes these IDs to citeproc from the item picker. We also need to consider existing embedded items in Word/LO documents, but they do have embedded URIs, so it shouldn't be a problem.
CC @fbennett
2015-05-26 16:11:44 -05:00
Aurimas Vinckevicius
c84a16984b Map note excerpt to title in itemToCSLJSON
This way notes have some sort of user-friendly way of being traced from Word documents to Zotero items in the library
2015-05-26 16:11:44 -05:00
Aurimas Vinckevicius
f6083068cd Fix display of pending tests 2015-05-26 16:11:43 -05:00
Aurimas Vinckevicius
1d1eb74e57 Add tests for Zotero.Translate.ItemGetter.prototype.nextItem 2015-05-26 16:11:43 -05:00
Aurimas Vinckevicius
409553da2e Add getTempDirectory (async) method to support.js
Returns a promise for a path to a new temporary directory
2015-05-26 16:11:42 -05:00
Aurimas Vinckevicius
2ebce91ecf Add -g flag to runtests.sh to generate test data
Add functions to generate sample data for various formats
* Zotero Web API JSON (Zotero.Item::toJSON)
* CiteProc-JS JSON
* Export translator JSON
* Direct serialization of Zotero.Item fields
Add a way to load sample data into DB from JSON
Add tests for loading sample data into DB
Add tests for automatically generated data
This will help us make sure that field mappings and data formats don't change
2015-05-26 16:04:55 -05:00
Aurimas Vinckevicius
47bf9c38e9 Transition item Export Format to Zotero web API item JSON
* Enable legacy mode for export translators compatible with pre-4.0.27:
   * Add compatibility mappings, so that current translators don't break if they specify minVersion lower than 4.0.27. This does introduce non-compatible changes, specifically, "version" field in legacy mode is "versionNumber" in the new format. "version" in the new format corresponds to the "version" as specified for Zotero API JSON format. New translators should expect Zotero web API JSON format and should specify minVersion 4.0.27.
* Update CSL mappings to comply with new itemToExportFormat
* CSL JSON export translator needs to be updated to be compatible with 4.0.27 to export correct CSL JSON
* Use item URI for id in CSL JSON instead of item ID
* Fix note and attachment handling in itemToCSLJSON
2015-05-26 15:48:43 -05:00
Aurimas Vinckevicius
2566ca27e0 Don't report translator failures from tests 2015-05-02 15:30:25 -05:00
Dan Stillman
96f3cc1861 Enable debug.time pref in tests 2015-04-15 00:48:03 -04:00
Dan Stillman
9511c43432 Create empty data directory in test profile
This prevents the data directory migration prompt from showing up if
there's an existing data directory inside the Standalone profile.
2015-04-12 20:28:50 -04:00
Aurimas Vinckevicius
f6510419cb Skip test for "recognizePDF without DOI" on Travis-CI
Breaks due to CAPTCHA when tests are run frequently
2015-04-06 23:17:41 -05:00
Aurimas Vinckevicius
ac363101fc Always use latest Firefox version and echo it for tests
Don't echo version on Windows, because it hangs Firefox
Also add testing with Firefox Beta (and prior ESR, but commented out for now, since we don't support it and we know it breaks)
2015-04-06 23:16:44 -05:00
Aurimas Vinckevicius
cc173ff1e5 Trim down ISSN/ISBN test for characters that should not be ignored 2015-03-30 16:28:12 -05:00
Aurimas Vinckevicius
a6e9f0aea0 Add tests for ISSN/ISBN-related Zotero.Utilities functions 2015-03-25 21:25:38 -05:00
Aurimas Vinckevicius
9624f6fac3 Fix runtests.sh to work with cygwin 2015-03-24 02:13:09 -05:00
Dan Stillman
7519287fa8 Fix JS version declaration for test support scripts 2015-03-24 02:27:33 -04:00
Simon Kornblith
a5ce4d2a66 Lengthen timeout for ISBN tests
I think the failures are actually LoC timing out.
2015-03-11 14:37:52 -04:00
Simon Kornblith
3583793571 Wait for bundled file updates to complete before running tests 2015-03-11 13:32:25 -04:00
Simon Kornblith
8253b98134 Remove index.js and just enumerate the files in the test directory 2015-03-09 17:41:49 -04:00
Simon Kornblith
4c45685331 Add header to EventUtils.jsm 2015-03-09 17:40:58 -04:00
Simon Kornblith
4a4073652f updateBundledFiles before using translators and wait for completion 2015-03-09 17:17:53 -04:00
Simon Kornblith
c2d32c2e27 Just give up on trying to automate the panel itself 2015-03-09 16:49:50 -04:00
Simon Kornblith
c7c58f8343 Add support function to reset the DB and a test that it works. 2015-03-09 14:25:49 -04:00
Simon Kornblith
b6673511f7 Close recognizePDF windows when tests finish 2015-03-08 19:28:33 -04:00
Simon Kornblith
299009dcd5 Add unit tests for add item by identifier and some support refactoring
Also adds EventUtils from MozMill to simplify UI automation.
2015-03-08 19:28:27 -04:00
Simon Kornblith
218917f367 Add unit test for PDF recognition without DOI 2015-03-08 16:20:57 -04:00
Simon Kornblith
3f0f7af71a Add unit test for PDF recognition with DOI
Also some support code that was useful here and will probably be
useful for other tests. This is a pretty complicated thing to test, but
it seems to work.
2015-03-08 16:02:10 -04:00
Simon Kornblith
50cd396918 Make debugging tests a bit easier
- Add command-line argument to enable debug logging
- Add command-line argument to open (and leave open) jsconsole
- Try to print error stack traces (although Mocha doesn't seem to like
  them?)
2015-03-07 22:17:44 -05:00
Simon Kornblith
1c32db68da Unit testing infrastructure
Implements the beginnings of unit testing infrastructure using
mocha/chai. The unit tests can be run locally using test/runtests.sh,
although this will need tweaks to run on Windows. They should also run
on commit using Travis-CI.

The unit tests themselves live in test/tests. The index.js file
specifies separate test sets, which can be run individually by calling
test/runtests.sh <testsets>. Right now there is only a single unit
test, but hopefully we'll have more soon...
2015-03-07 16:34:55 -05:00