Skip to content

Commit

Permalink
Issue #3122547 by dww, Kristen Pol, jungle: Fix duplicate word typos …
Browse files Browse the repository at this point in the history
…(the the, to to, etc) for test assertions
  • Loading branch information
xjm committed May 1, 2020
1 parent 411c18e commit cc19e5f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testParserInfoAlter() {
$widget_definition = \Drupal::service('plugin.manager.aggregator.parser')->getDefinition('aggregator_test_parser');

// Test if hook_aggregator_parser_info_alter is being called.
$this->assertTrue($widget_definition['definition_altered'], "The 'aggregator_test_parser' plugin definition was updated in in `hook_aggregator_parser_info_alter()`");
$this->assertTrue($widget_definition['definition_altered'], "The 'aggregator_test_parser' plugin definition was updated in `hook_aggregator_parser_info_alter()`");
}

/**
Expand All @@ -45,7 +45,7 @@ public function testProcessorInfoAlter() {
$widget_definition = \Drupal::service('plugin.manager.aggregator.processor')->getDefinition('aggregator_test_processor');

// Test if hook_aggregator_processor_info_alter is being called.
$this->assertTrue($widget_definition['definition_altered'], "The 'aggregator_test_processor' plugin definition was updated in in `hook_aggregator_processor_info_alter()`");
$this->assertTrue($widget_definition['definition_altered'], "The 'aggregator_test_processor' plugin definition was updated in `hook_aggregator_processor_info_alter()`");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if (action === 'add') {
messageObjects[area].indexes[type].push(
message.add(
`This is a message of the type, ${type}. You be the the judge of its importance.`,
`This is a message of the type, ${type}. You be the judge of its importance.`,
{ type },
),
);
Expand All @@ -71,7 +71,7 @@
messageObjects.default.zone.add(
`This is message number ${i} of the type, ${
testMessages.types[i % testMessages.types.length]
}. You be the the judge of its importance.`,
}. You be the judge of its importance.`,
{ type: testMessages.types[i % testMessages.types.length] },
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
var action = $target.attr('data-action');

if (action === 'add') {
messageObjects[area].indexes[type].push(message.add('This is a message of the type, ' + type + '. You be the the judge of its importance.', { type: type }));
messageObjects[area].indexes[type].push(message.add('This is a message of the type, ' + type + '. You be the judge of its importance.', { type: type }));
} else if (action === 'remove') {
message.remove(messageObjects[area].indexes[type].pop());
}
});
$('[data-action="add-multiple"]').once('add-multiple').on('click', function () {
[0, 1, 2, 3, 4, 5].forEach(function (i) {
messageObjects.multiple.push(messageObjects.default.zone.add('This is message number ' + i + ' of the type, ' + testMessages.types[i % testMessages.types.length] + '. You be the the judge of its importance.', { type: testMessages.types[i % testMessages.types.length] }));
messageObjects.multiple.push(messageObjects.default.zone.add('This is message number ' + i + ' of the type, ' + testMessages.types[i % testMessages.types.length] + '. You be the judge of its importance.', { type: testMessages.types[i % testMessages.types.length] }));
});
});
$('[data-action="remove-multiple"]').once('remove-multiple').on('click', function () {
Expand Down
6 changes: 3 additions & 3 deletions tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function testAddRemoveMessages() {
$selector = "$messagesSelector .messages.messages--$type";
$msg_element = $web_assert->waitForElementVisible('css', $selector);
$this->assertNotEmpty($msg_element, "Message element visible: $selector");
$web_assert->elementContains('css', $selector, "This is a message of the type, $type. You be the the judge of its importance.");
$current_messages[$selector] = "This is a message of the type, $type. You be the the judge of its importance.";
$web_assert->elementContains('css', $selector, "This is a message of the type, $type. You be the judge of its importance.");
$current_messages[$selector] = "This is a message of the type, $type. You be the judge of its importance.";
$this->assertCurrentMessages($current_messages, $messagesSelector);
}
// Remove messages 1 by 1 and confirm the messages are expected.
Expand All @@ -69,7 +69,7 @@ public function testAddRemoveMessages() {
$types = JSMessageTestController::getTypes();
$nb_messages = count($types) * 2;
for ($i = 0; $i < $nb_messages; $i++) {
$current_messages[] = "This is message number $i of the type, {$types[$i % count($types)]}. You be the the judge of its importance.";
$current_messages[] = "This is message number $i of the type, {$types[$i % count($types)]}. You be the judge of its importance.";
}
// Test adding multiple messages at once.
// @see processMessages()
Expand Down

0 comments on commit cc19e5f

Please sign in to comment.