- Issue created by @tedbow
Reading through \Drupal\Tests\experience_builder\Functional\XbConfigEntityHttpApiTest::testJavaScriptComponent
for another issue I ran across this block
// โ ๏ธThis is changing it from `exposed` โ `internal`. This must cause the
// `Component` config entity to continue to exist, but get its `status` to
// change to `FALSE`, and cause it to be omitted from the list of available
// components for the Content Creator.
// @todo https://www.drupal.org/i/3500043 will disallow PATCHing this if > 0 uses of this component exist.
$code_component_to_send['status'] = FALSE;
$expected_component['status'] = FALSE;
$request_options[RequestOptions::BODY] = self::encodeXBData($code_component_to_send);
$body = $this->assertExpectedResponse('PATCH', Url::fromUri('base:/xb/api/config/js_component/test'), $request_options, 200, NULL, NULL, NULL, NULL);
$this->assertSame($expected_component, $body);
// Confirm that the code component IS exposed, because `status` was just
// changed to `TRUE`.
// @see docs/config-management.md#3.2.1
$this->assertNotNull(Component::load('js.test'));
$this->assertFalse(Component::load('js.test')->status());
$this->assertExposedCodeComponents([], 'MISS', $request_options);
$this->assertExposedCodeComponents([], 'HIT', $request_options);
This comment here is at least wrong
/ Confirm that the code component IS exposed, because `status` was just
// changed to `TRUE`.
Because above we actual set it to false the assert below show that IS NOT exposed.
If you search for "// Confirm that the code component IS exposed, because" you will see that same comment is repeated above this where it actually true. Probably just a case of copying the code block to test setting to false
and updating the assertions but not the comments
I have not read through the rest of the comments but we should probably check them too
Fix the comments
Active
0.0
Internal HTTP API