66 Commits

Author SHA1 Message Date
ulferts db815d0d22 Merge remote-tracking branch 'origin/dev' into merge-release/17.5-20260609045502 2026-06-09 09:32:19 +02:00
Judith Roth 595872727c [STC-779] Add tests for CTRL-Z in documents
https://community.openproject.org/wp/STC-779
2026-06-08 16:26:19 +02:00
Alexander Brandon Coles fa5b7ee1b5 Merge remote-tracking branch 'opf/dev' into merge-release/17.5-20260603051246 2026-06-03 09:52:08 +02:00
Judith Roth 90317785d7 [#74654] Test markdown generation of BlockNote extensions
https://community.openproject.org/wp/74654
2026-06-02 17:02:40 +02:00
OpenProject Actions CI b2f72fd486 Merge branch 'release/17.5' into dev 2026-05-30 04:49:04 +00:00
Judith Roth 4dd97c267c [#75231] Add tests for inserting WP links with # notation
https://community.openproject.org/wp/75231

in BlockNote editor
2026-05-29 10:30:29 +02:00
Judith Roth f1b1ab307d [#75231] Fix test for op-blocknote-extensions in open project
https://community.openproject.org/wp/75231
2026-05-29 10:30:29 +02:00
Kabiru Mwenja 8a213e2c03 Move browser-action helpers to spec/support sibling file
Park BlockNoteEditorBrowserActions next to BlockNoteEditorInput in
spec/support/form_fields/primerized/. spec/support/**/*.rb is autoloaded
by rails_helper, so the spec file just `include`s the qualified module
name. Keeps raw-driver concerns (DOM Range selection, paste
ClipboardEvent dispatch, W3C-action Delete) out of the high-level page
object — that one stays focused on semantic actions like paste_links
and attach_file — and avoids the test-file fatigue of a 50-line helper
module inside the describe scope.
2026-05-21 15:36:39 +03:00
Judith Roth f9b0f21c8b Merge pull request #23009 from opf/jr/bump/op-blocknote-extensions-version-to-0-0-24
Update op-blocknote-extensions to version 0.0.24 for improvements in the search input
2026-05-05 13:12:10 +02:00
Judith Roth c38d935f59 [#69706] Fix tests for op-blocknote-extensions 0.0.24
In 0.0.24 a callback was added that removes the whole search input from
the DOM / document when a blur event (e.g. clicking anywhere else)
occurs. This broke the capybara tests, since they somehow triggered that
blur and then the whole input was removed from the DOM before the tests
were finished testing it.
Therefore now all interaction of with the work package search input is
done via js whithout any interruptions that cause a blur event.
I am not happy about this solution and asked to relax that blur
requirement to e.g. only remove the search when the document / browser
tab is closed, but this was refused. So this is the only solution to
keep the tests in at all.

https://community.openproject.org/wp/69706
2026-05-04 14:51:36 +02:00
Kabiru Mwenja 92a1346f81 Merge pull request #22696 from opf/feature/blocknote-native-extensions
(Blocknote): Add external link capture
2026-04-23 13:41:48 +03:00
Kabiru Mwenja fe78cdf3ee Address code review feedback
Narrow closest('a') result with instanceof HTMLAnchorElement for
type safety. Skip non-web protocols (mailto:, tel:, etc.) in
isExternalLinkCandidate to match body-level controller behavior.
Pass element reference to paste_links JS instead of global querySelector.
2026-04-23 12:15:18 +03:00
Kabiru Mwenja 8a48ee7a22 Add click-interception for external links in BlockNote editor
ProseMirror's internal DOMObserver re-parses and re-renders any node
whose attributes change, creating infinite loops when the body-level
ExternalLinksController writes target, rel, aria-describedby, or
rewrites href on links inside the editor.

Instead of modifying the DOM, a standalone ProseMirrorExternalLinksController
intercepts clicks on external links and routes them through
/external_redirect via window.open. The document model retains original
URLs, Yjs collaboration is unaffected, and no re-render loops occur.

TipTap's Link extension already renders target="_blank" and
rel="noopener noreferrer nofollow" from its mark schema defaults,
so those attributes are handled natively by ProseMirror.

Shared link utilities (isLinkExternal, shouldProcessLink,
buildRedirectUrl) are extracted into link-handling helpers so both
controllers use a single source of truth without inheritance coupling.
2026-04-23 12:15:16 +03:00
Oliver Günther e1049c9cf6 Try to fix ./spec/features/projects/project_custom_fields/overview_page/update_spec.rb:94 2026-04-16 14:33:46 +02:00
Henriette Darge 60a23150df Replace qaFieldName with testSelector 2026-03-20 12:46:38 +01:00
Henriette Darge adb88c979b Some more test fixing.. There is light and the end of the tunnel :fingers_crossed: 2026-03-19 15:10:27 +01:00
Henriette Darge ee83264379 Continue the endless journey of adapting the tests to the new inplaceEditFields. 2026-03-18 14:03:52 +01:00
Henriette Darge c82f493c9f [71069] Use autocompleters in Admin/Backlogs page (#21841)
* Replace selectPanel with autocompleters

* Fix specs for updated autocompleter

* Attempt to fix test

* Replace ng.getComponent by ViewChild API
2026-02-11 13:57:03 +01:00
Judith Roth 57891a2aff [#70961] Add test for link work package block (BlockNote)
https://community.openproject.org/work_packages/70961
2026-01-26 14:47:11 +01:00
Judith Roth 9f4f348d5a [#70541] Fix tests that broke with the shadow dom changes
https://community.openproject.org/work_packages/70541

With capybara, you can not select elements within the shadow dom
directly. You always have to:
1. Select the element that hosts the shadow dom
2. Call `shadow_root` on this element
3. Select from there

Unfortunately, capybara's `within` does not work with the shadow dom,
so you have to do this every time.

Also, this only works with selenium, not with cuprite. Cuprite does
not yet support the shadow dom enough.
2026-01-19 13:21:41 +01:00
Bruno Pagno 196b8648e6 fix shadowdom-capybara specs 2025-12-12 09:33:26 +01:00
Bruno Pagno ff1b957e31 use BlockNote as a custom element under a shadow dom root
- updated blocknote version
- updated op-blocknote-extensions version
- injecting CSS into the shadow dom
2025-12-12 09:32:54 +01:00
Oliver Günther 8a4c4ec30b Adapt specs 2025-11-26 14:15:31 +01:00
Christophe Bliard bae42c8231 Fix flaky spec
spec is spec/features/projects/project_custom_fields/overview_page/dialog/inputs_spec.rb:702
run is https://github.com/opf/openproject/actions/runs/19700308113/job/56434713171?pr=21163

When opening the options of the dropdown, the field is clicked. If unlucky, it can click on the "X" of an option already selected and remove it. When this happens, it does not open the dropdown (this explains why the previous run was flaky).

The default implementation in both Cuprite and Selenium is to click in
the middle of the element. I don't understand why we can't reproduce it
though.

Fix is to click the arrow directly.
2025-11-26 12:25:33 +01:00
Christophe Bliard 1015dce948 Try to fix a flaky spec
spec is spec/features/projects/project_custom_fields/overview_page/dialog/inputs_spec.rb:702
run is https://github.com/opf/openproject/actions/runs/19696080834/job/56421276049?pr=21163

Not entirely sure what's going on, but on the screenshot the field looks
active, so it's clicked, but for some reason the options are not
visible.

Try to work around the issue by waiting for the options to be visible,
and click the input again if not. Check every 0.25 seconds and try for 3
seconds before giving up.
2025-11-26 11:17:01 +01:00
Kabiru Mwenja 681d19e6ba Add happy path for collaborative editing 2025-11-12 20:48:18 +03:00
Kabiru Mwenja 0b31ccfd36 DRY editor finder 2025-11-12 20:48:17 +03:00
Judith Roth e6cdd9945b [#68606] Add i18n for BlockNote
https://community.openproject.org/work_packages/68606
2025-10-30 15:49:34 +01:00
Judith Roth c9a2aded2d Merge pull request #20752 from opf/bug/67403-blocknote-does-not-handle-uploading-attachments
[#67403] Blocknote: upload attachments

# Ticket
https://community.openproject.org/wp/67403

# What are you trying to accomplish?
Allow to upload files as attachments to documents in blocknote, the new editor for documents.
2025-10-24 10:52:59 +02:00
Judith Roth fef8a325ca [#67403] Add tests
https://community.openproject.org/wp/67403
2025-10-24 09:32:32 +02:00
Dombi Attila 29d0569420 Fix specs and rename the edit dialog title to "Edit attribute" 2025-10-21 00:06:08 +03:00
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Oliver Günther 8c7051fbeb Add test selector, fix name label association 2025-04-30 08:36:57 +02:00
Christophe Bliard 083f939fe3 Fix flaky spec
spec is ./modules/reporting/spec/features/update_entries_spec.rb:72
job run is https://github.com/opf/openproject/actions/runs/14646323170/job/41135997810

It was failing when submitting the time logging modal before the work
package was loaded. As it was not loaded, it was empty, and as it was
empty, it was displaying an error "Work package is invalid" and the time
was not updated.

As the time was not updated, the spec was failing looking for "2.00
hours" (the new value) but only getting "5.00 hours" (the old value).

Fix is to wait for the autocompleter to be fully loaded before
proceeding with submit. This is done by waiting for `ng-spinner-loader`
to not be visible anymore.
2025-04-25 11:01:18 +02:00
Dombi Attila 034e94927d [#62160] The Version custom field options are not grouped on the project general settings page
https://community.openproject.org/work_packages/62160
2025-03-13 14:02:07 +02:00
Dombi Attila cd61935a82 Update the option expectations with grouping argument 2025-03-05 12:45:08 +01:00
Dombi Attila 54bec93630 Add project list version custom field filter specs 2025-03-05 12:45:08 +01:00
Dombi Attila 4348dc9e95 Add option grouping expectation to the Project custom fields dialog spec 2025-03-05 12:45:08 +01:00
Christophe Bliard 7a83b5b094 Fix flaky test
Flaky test is
./spec/features/projects/project_custom_fields/overview_page/dialog/inputs_spec.rb:337
failing in
https://github.com/opf/openproject/actions/runs/9796977844/job/27052576076?pr=16041
2024-07-05 08:13:12 +02:00
Henriette Darge 04c876341f Check whether the autocompleter is finished loading before starting the test 2024-07-04 08:32:18 +02:00
Oliver Günther 4f3704cef1 Close autocompleter in dialog 2024-04-22 16:11:53 +02:00
Ivan Kuchin 6678cab48d auto correct quotes 2024-03-28 18:22:34 +01:00
jjabari-op b4590b4f64 Merge branch 'dev' into epic/49688-custom-set-of-project-attributes-grouped-in-sections 2024-03-21 05:21:28 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Dombi Attila a1b612d5d8 Respect allow_non_open_versions setting on the version input, do not wait on non existence expectations. 2024-02-29 18:56:01 +02:00
Jonas Jabari 34a4640dc4 adding more validation specs and fixing selected values state after validation for multi select fields 2024-02-27 15:19:35 +07:00
Jonas Jabari 5c5aae175d added missing validation specs 2024-02-27 14:27:39 +07:00
Jonas Jabari 809880727e added dialog update specs and split spec file for better oversight 2024-02-16 15:45:39 +07:00
Jonas Jabari 9e6a72594d fixed dialog validation specs 2024-02-01 16:30:28 +07:00
Jonas Jabari 3de8c22114 support rich text input 2024-02-01 15:26:57 +07:00