Follow-up to #2504587: Job overview: target language missing

Problem/Motivation

The job overview form needs a better test coverage.

Proposed resolution

Test the different fields, filters, links.

Remaining tasks

User interface changes

API changes

Comments

giancarlosotelo’s picture

Status: Active » Needs review
StatusFileSize
new1.89 KB

Added tests.

LKS90’s picture

Status: Needs review » Needs work

+++ b/src/Tests/TMGMTUiTest.php
@@ -249,6 +249,50 @@ class TMGMTUiTest extends TMGMTTestBase {
+ $this->drupalGet('admin/tmgmt/jobs', array('query' => array(
+ 'state' => '1',
+ 'target_language' => 'de',
+ 'source_language' => 'en',
+ )));

Use drupalPostForm instead, the path is the same, the $edit will be your 'query' array, and the last parameter is the label of the button you want to push, in this case t('Apply').

+++ b/src/Tests/TMGMTUiTest.php
@@ -249,6 +249,50 @@ class TMGMTUiTest extends TMGMTTestBase {
+    // Test if source language is correct.
+    $this->assertRaw('class="views-field views-field-source-language-1">
+            English');
+
+    // Test if target languages are correct.
+    $this->assertRaw('class="views-field views-field-target-language">
+            Spanish');
+    $this->assertRaw('class="views-field views-field-target-language">
+            German');

Possible, but an xpath query would probably be nicer.

//table[@class='views-table views-view-table cols-9']/tbody/tr/td[@class='views-field views-field-target-language']

Returns the column with all target languages.

berdir’s picture

1. This is a views filter form which uses GET, not POST. So you can't post it :) This is correct.

giancarlosotelo’s picture

Status: Needs work » Needs review
StatusFileSize
new2.02 KB
new1.71 KB

Here is the patch with recommendations.

LKS90’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Yummy, moar tests.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.