Problem/Motivation

We currently have no tests for inline editing functionality.

Proposed resolution

Provide test coverage.

Remaining tasks

User interface changes

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sasanikolic’s picture

Status: Active » Needs review
FileSize
8.33 KB

Added the test for inline editing.
Probably would be good to separate this test in a new method?

miro_dietiker’s picture

+++ b/src/Tests/ParagraphsAdministrationTest.php
@@ -328,6 +348,108 @@ class ParagraphsAdministrationTest extends WebTestBase {
+    $form_tokens_found = preg_match('/\sname="form_token" value="([^"]+)"/', $ajax_commands[0]['data'], $token_match) && preg_match('/\sname="form_build_id" value="([^"]+)"/', $ajax_commands[0]['data'], $build_id_match);
...
+    if ($form_tokens_found) {

Why would you want to do this conditionally?

In any case, if you really need to stop a test, use the return statement conditionally. Always avoid valueless indentation.

Finally the test method is getting crazily long... If not now, then we really need a followup to split the method.

sasanikolic’s picture

Separated the test into a new method here.

The conditional was from the QuickEditLoadingTest (quickedit core test). I have removed it in this patch.

Also, changed the misspelling from 'TEST TITEL' to 'TEST TITLE'.

miro_dietiker’s picture

Status: Needs review » Needs work

Big chunks really look like a test that tests the core quickedit functionality in step details.

We depend on this test. We trust core does it right. We don't need to repeat the internals. If you want, just add a reference with @see.
I think we only should check that Paragraphs inline changes are stored properly and output.

The problem with this test in general is that it is not driven by a JS browser. Much more it tests what a JS aware client would execute. There's still a lot of room for things to break.

miro_dietiker’s picture

Status: Needs work » Postponed
Related issues: +#2476863: [META] Integrate more nicely with quick edit

What i just realised is that inline editing is subject to change anyway in Paragraphs...

I think we should postpone this test until #2476863: [META] Integrate more nicely with quick edit