diff --git a/sources/content/src/Tests/ContentEntitySourceUiTest.php b/sources/content/src/Tests/ContentEntitySourceUiTest.php index 0e66e9c..9151521 100644 --- a/sources/content/src/Tests/ContentEntitySourceUiTest.php +++ b/sources/content/src/Tests/ContentEntitySourceUiTest.php @@ -189,6 +189,15 @@ class ContentEntitySourceUiTest extends EntityTestBase { ); $this->drupalPostForm(NULL, $edit, t('Request translation')); $this->drupalPostForm(NULL, array(), t('Submit to provider')); + $edit = array( + 'languages[fr]' => TRUE, + ); + $this->drupalPostForm(NULL, $edit, t('Request translation')); + $edit = array( + 'target_language' => 'de', + ); + $this->drupalPostForm(NULL, $edit, t('Submit to provider')); + $this->assertText(t('1 conflicting item has been dropped.')); $this->clickLink(t('Needs review')); // Delete the node and assert that the job can not be accepted. diff --git a/src/Tests/TMGMTCartTest.php b/src/Tests/TMGMTCartTest.php index b7ff302..580daa7 100644 --- a/src/Tests/TMGMTCartTest.php +++ b/src/Tests/TMGMTCartTest.php @@ -97,6 +97,23 @@ class TMGMTCartTest extends TMGMTTestBase { $this->drupalGet('admin/tmgmt/cart'); $this->assertText($node_cs->getTitle()); $this->assertNoText($node_sk->getTitle()); + + // Test that duplicate submission of an item is not allowed. + $this->drupalPostForm('admin/tmgmt/cart', array( + 'target_language[]' => array('es'), + ), t('Request translation')); + + $job_item_cs = tmgmt_job_item_create('content', 'node', $node_cs->id()); + $job_item_cs->save(); + $this->drupalGet('tmgmt-add-to-cart/' . $job_item_cs->id()); + $job_items_data[$job_item_cs->getItemId()] = $job_item_cs->getItemType(); + + $this->drupalPostForm('admin/tmgmt/cart', array( + 'target_language[]' => array('es'), + ), t('Request translation')); + $this->assertText(t('1 item conflict with pending item and will be dropped on submission.')); + $this->drupalPostForm(NULL, array(), t('Submit to provider')); + $this->assertText(t('1 conflicting item has been dropped.')); } } diff --git a/src/Tests/TMGMTUiReviewTest.php b/src/Tests/TMGMTUiReviewTest.php index 3f88e60..3485de3 100644 --- a/src/Tests/TMGMTUiReviewTest.php +++ b/src/Tests/TMGMTUiReviewTest.php @@ -348,6 +348,9 @@ class TMGMTUiReviewTest extends EntityTestBase { $job1->set('translator', $translator1->id())->save(); $job2->set('translator', $translator2->id())->save(); + // Test that progress bar is being displayed. + $this->assertRaw('class="tmgmt-progress-pending" style="width: 50%"'); + // Filter jobs by translator and assert values. $this->drupalGet('admin/tmgmt/jobs', array('query' => array('translator' => $translator1->id()))); $label = trim((string) $this->xpath('//table[@class="views-table views-view-table cols-10"]/tbody/tr')[0]->td[4]); @@ -393,7 +396,6 @@ class TMGMTUiReviewTest extends EntityTestBase { $this->assertRaw('class="tmgmt-color-legend clearfix"'); // Test that progress bar is being displayed. - $this->assertRaw('class="tmgmt-progress-pending" style="width: 50%"'); $this->assertRaw('class="tmgmt-progress-translated" style="width: 100%"'); }