Commit graph

1757 commits

Author SHA1 Message Date
Bogdan Abaev
098be27375 citation dlg: fix row cutoff on linux after resize
When resizing the window in list mode to match the height
of the content, account for the difference between
outerHeight and innerHeight of the window on Linux.
outerHeight > innerHeight (perhaps Linux includes chrome,
borders, etc. in its outerHeight), so we have to add their difference
to the desired height for resizing. Otherwise, the visible
dialog ends up receiving only some of the desired height and
the last row is cut off.

Also, ensure that in tests, we wait for searching triggered by
switching dialog mode to finish before running the next search.

Fixes: zotero#5502
2025-08-21 11:50:10 +03:00
windingwind
7f9418fe98
Implement custom menu API (#5028) 2025-08-20 02:10:35 -04:00
Abe Jellinek
8eb803292e Clear pane.persist in tests (#5495) 2025-08-20 02:00:31 -04:00
Dan Stillman
bf59a1e2f8 Revert "Fix relations to erased items reappearing after sync (#5486)"
I think this might cause problems and needs to be tested further.

This reverts commit 07066fd8c1.
2025-08-15 02:09:18 -04:00
abaevbog
07066fd8c1
Fix relations to erased items reappearing after sync (#5486)
Fix ghost relations to erased items reappearing after
sync. The dataserver ensures that related relations are
bidirectional. If a related item is erased, syncing
would first upload the update to the remaining related item
(where the relation is removed), followed by the deletions.
While handling update upload, the dataserver would return
the old, should-be-removed, "dc:relation" entry for that item
because it does not know that the other item is erased.

To handle this, swap the order of operations during sync:
upload deletion first and then upload updates after.
Then, when the dataserver handles the update of the non-erased item,
there is no related item to enforce bidirectional relations to.

Fixes: #5481
2025-08-15 02:00:43 -04:00
abaevbog
8b0f8d7c20
avoid relation to self after merging related items (#5488)
When copying over relations during merge of items
that are related to one another, avoid relating the
chosen main item to itself.

Fixes: #5487
2025-08-15 01:40:01 -04:00
Abe Jellinek
86f9dd7400
Handle invalid path when launching/revealing on macOS (#5485) 2025-08-15 01:29:05 -04:00
Abe Jellinek
d69a1a65ee Fix intermittent context pane toggle test failure
Hopefully.
2025-08-14 17:52:28 -04:00
abaevbog
f3227275b1
filter out trashed items in relatedBox (#5482)
If the item itself is trashed, all related items are displayed
(trashed or not).

Fixes: #1780
2025-08-13 23:56:40 -04:00
Abe Jellinek
f8a1a2c6ed
Don't merge into a missing snapshot attachment (#5459) 2025-08-02 01:53:47 -04:00
abaevbog
487677958e
fix subcollection not being copied to library root (#5464)
Fixes: #5463
2025-08-02 01:50:54 -04:00
abaevbog
873beebc0f
close more leftover windows in tests (#5460)
- close hyphenationTest window.
- properly close zoteroPane window in preferences_syncTest.
after() hook inside of the test would not close the window until the
very end of the entire test run. Without this, during
subsequent tests that open their own zoteroPane window, there
are two instances of zoteroPane open at the same time.
- close open tabs in readerTest cleanup, since subsequent
tests expect library tab to be selected.

Followup to https://github.com/zotero/zotero/pull/5444#issuecomment-3141879892
2025-08-02 01:40:21 -04:00
abaevbog
b1e163b7f5
fx140: Use architecture-specific build folder for tests on Linux (#5445) 2025-07-31 22:48:21 -04:00
Dan Stillman
87d27f9c51
Close ProgressQueueDialog after connector server tests (#5446)
Since some connector operations trigger recognition

This will hopefully fix the tags box test failures.
2025-07-31 21:54:15 -04:00
windingwind
773ca6f724
Improve item pane test stability (#5436) 2025-07-31 21:51:40 -04:00
Dan Stillman
5063a8b396 isAbove → isAtLeast in sync engine tests for testing delays
Maybe related to Bluebird?
2025-07-31 10:45:19 -04:00
windingwind
08e2be9875 fx140: fix item pane test further
Should call updateLayout after changing layout
Should wait for notify after saving object
2025-07-30 22:31:11 -04:00
windingwind
0ce54e2b14 Fix item pane test failure
fix: #5421
2025-07-30 22:31:11 -04:00
windingwind
d1c6ee33be Fix plugin API test failure
Fix: #5411
2025-07-30 22:31:09 -04:00
Abe Jellinek
0a62553746 Remove remaining chai-as-promised method calls 2025-07-30 22:31:08 -04:00
Abe Jellinek
9442b7ee6c Fix Zotero.Feed tests after chai-as-promised removal 2025-07-30 22:31:08 -04:00
Abe Jellinek
7e706354f9 Don't try to reject last feed item when FeedReader terminates
As the comment says, this hasn't been useful (and isn't used anywhere),
and I honestly don't understand how the test ever passed - process()
would've resolved all the feed item promises already.

Fixes #5412
2025-07-30 22:31:08 -04:00
Dan Stillman
f81763b173 Remove Chai as Promised
A test using `assert.eventually` was failing after the Bluebird removal
but worked with just `await`, and since there hasn't really been much
point to Chai as Promised since the introduction of `async`/`await` ages
ago, just remove the library instead of figuring out why.
2025-07-30 22:31:08 -04:00
Dan Stillman
6809aa50ad Fix item tree tests after Bluebird removal
Remove uses of PromiseInspection.value()
2025-07-30 22:31:07 -04:00
Dan Stillman
0bf4fc54c4 Remove uses of Promise.isFulfilled() in connector server tests 2025-07-30 22:31:07 -04:00
Dan Stillman
c2b6a9cc12 fx140: Fix NetUtil import in server tests 2025-07-30 22:31:03 -04:00
Dan Stillman
c4cfee1807 fx140: Fix additional mendeleyImport.mjs imports 2025-07-30 22:30:58 -04:00
Abe Jellinek
97dbcc6870 Restore timeout in dataObjectTest.js, fix test
OK, the timeout removed in 05e8da wasn't actually useless, but this test
was.

41706a changed erase() so it no longer forwards skipNotifier when
deleting child items. That means that we *would* get a notify() call for
the deleted child, so the test should have been failing.

However! Because of a bug in Bluebird's filtered catch() implementation,
Promise.TimeoutError wasn't recognized as an Error subclass, and it was
instead used as a predicate function, which would always pass.

So all errors were caught as "timeouts" and suppressed, making this test
always pass. Now it no longer always passes (but does pass with the
current behavior).
2025-07-30 22:30:57 -04:00
Abe Jellinek
6203b9712d Fully asyncify feedTest.js 2025-07-30 22:30:57 -04:00
Abe Jellinek
20e75c3251 Remove Bluebird methods in concurrentCallerTest.js
This is really messy and not ideal, but these tests were written for
Bluebird Promise state inspection, and it's difficult to make them look
nice without that being available.
2025-07-30 22:30:57 -04:00
Abe Jellinek
2bc0afa830 Remove useless timeout() in dataObjectTest.js 2025-07-30 22:30:57 -04:00
Abe Jellinek
d9341bbf1a Use alternate method to test feed check delay 2025-07-30 22:30:56 -04:00
Abe Jellinek
2b7535cd83 Fix test runner
By restoring ZOTERO_TEST=1 in runtests.sh after 711b336.
2025-07-30 22:30:56 -04:00
Abe Jellinek
964b5a0e88 fx140: Fix remaining bare ChromeUtils.import() calls 2025-07-30 22:30:54 -04:00
Dan Stillman
3e0d2c06f1 Support arch-specific builds on Windows and Linux
`fetch_xulrunner`, `dir_build`, and `build.sh` now take an optional `-a`
argument on Windows and Linux to specify the architecture to
fetch/build. If `-a` is omitted for `dir_build` (as in `build_and_run`),
it defaults to the current architecture.

xulrunner hashes are now computed for each architecture. This changes
some filenames in xulrunner/, so you may want to clean out some old
folders/files.

This removes the custom handling for CI, since it will now default to
the architecture of the test runner.
2025-07-30 22:30:53 -04:00
Abe Jellinek
67d2e1cead fx140: Asyncify/ESMify tests
They seem to be succeeding when run individually, but failing when
run as a whole. Not sure why yet.
2025-07-30 22:30:53 -04:00
Abe Jellinek
b9e560d33e fx140: Remove EventUtils
Unused, relied on hiddenDOMWindow.
2025-07-30 22:30:38 -04:00
Abe Jellinek
488bcc484f Replace uses of Zotero.Promise.defer() as a constructor 2025-07-30 22:30:33 -04:00
Abe Jellinek
95038a7da5 fx140: ESMify RemoteTranslate and uses 2025-07-30 22:30:30 -04:00
Abe Jellinek
ece2b59700 fx140: More progress toward startup 2025-07-30 22:18:36 -04:00
Abe Jellinek
8d0923f119 fx140: Remove Bluebird
All module code runs in strict mode, and that breaks Bluebird.

And add a partial shim for the simplest and most useful methods. Not
sure if we actually want that, or if we should just replace it entirely
with native methods.
2025-07-30 22:18:35 -04:00
Abe Jellinek
78534ff2d2 FileHandlers: Infer PDF pageIndex from annotation key
And:

- Update createAnnotation() test support function to create valid EPUB
  and snapshot annotations
- Add more FileHandlers tests
2025-07-30 11:37:52 -04:00
Adomas Venčkauskas
11014be449 Server: Add support for UTF in server headers (RFC2047) 2025-07-24 13:26:23 +03:00
Dan Stillman
b31b71304d ZFS: Don't retry download for canceled redirect with mtime/hash match
This was a regression from the switch to `Zotero.HTTP.download()`. 302
wasn't a success code, so `HTTP.download()` would throw, and since the
status wasn't set correctly on the `XMLHttpRequest` within
`HTTP.UnexpectedStatusException`, it would think it was an interrupted
S3 connection and trigger another download after a delay.
2025-07-24 01:31:25 -04:00
Abe Jellinek
5e1541c5ee Extract activateZoteroPane(), try different activeness check
This should hopefully fix intermittent CI failures.
2025-07-23 11:23:36 -04:00
Dan Stillman
9b1950c9ea Clear HTTP.mock at end of ZFS tests 2025-07-22 22:12:52 -04:00
Dan Stillman
d1ea8a397b Use BrowserDownload for 403 when enforcing type in downloadFile()
Fixed regression (probably in 1f401f0897) causing Find Full Text not to
use BrowserDownload for a 403

https://forums.zotero.org/discussion/125581/zotero-suddenly-fails-to-retrieve-full-text-although-i-have-access
2025-07-22 22:12:00 -04:00
Dan Stillman
dd10111e5d Close all tabs before item tags box tests to try to fix CI failures 2025-07-15 01:01:54 -04:00
Dan Stillman
42e21d4fa1 Disable citeproc-rs tests, which are failing after Chicago style update
Note sure why
2025-07-15 00:46:10 -04:00
Dan Stillman
01683b6ccb More chicago-note-bibliography → chicago-shortened-notes-bibliography 2025-07-15 00:46:10 -04:00