Commit a7d5c0c6 authored by Fabrice Gangler's avatar Fabrice Gangler 🎨
Browse files

TEST(mapping): add some assertions for user page

Refs: #917
parent bdcc05cb
......@@ -352,7 +352,6 @@ class TaxonomysControllerTest extends ApiIntegrationTestCase
* @group taxonomy_public
* @group taxonomy_method_mappingTaxon
*
* @group wip_userPage
* @return void
*/
public function testMappingTaxonShouldHaveSoftwareWithUsers()
......@@ -399,18 +398,18 @@ class TaxonomysControllerTest extends ApiIntegrationTestCase
$r = $this->checkUrlOk($userUrl, ['html'], false);
$html = $r['html']['data'];
$this->assertContains("id=\"softwarePreviewCard-$idSoftware\"", $html);
// $this->assertContains("id=\"mappingForUser-$idUserA\"", $html);
// $this->assertContains("class=\"linkMappingTaxon\"", $html);
// $this->assertContains("id=\"linkMappingTaxon-$idTaxon\"", $html);
$this->assertContains("id=\"mappingForUser-$idUserA\"", $html);
$this->assertContains("class=\"linkMappingTaxon\"", $html);
$this->assertContains("id=\"linkMappingTaxon-$idTaxon\"", $html);
// on user (ID 10) page: found link for taxon ID 6
$userUrl = "/fr/users/$idUserB";
$r = $this->checkUrlOk($userUrl, ['html'], false);
$html = $r['html']['data'];
$this->assertContains("id=\"softwarePreviewCard-$idSoftware\"", $html);
// $this->assertContains("id=\"mappingForUser-$idUserB\"", $html);
// $this->assertContains("class=\"linkMappingTaxon\"", $html);
// $this->assertContains("id=\"linkMappingTaxon-$idTaxon\"", $html);
$this->assertContains("id=\"mappingForUser-$idUserB\"", $html);
$this->assertContains("class=\"linkMappingTaxon\"", $html);
$this->assertContains("id=\"linkMappingTaxon-$idTaxon\"", $html);
}
......
......@@ -128,7 +128,6 @@ class TaxonomysSoftwaresControllerTest extends ApiIntegrationTestCase
* @group taxonomy-software
* @group taxonomy-software_public
* @group taxonomy-software_mappingForm
* @group wip_userPage
*
* @return void
*/
......@@ -218,10 +217,10 @@ class TaxonomysSoftwaresControllerTest extends ApiIntegrationTestCase
$r = $this->checkUrlOk($userUrl, ['html'], false);
$html = $r['html']['data'];
$this->assertContains("id=\"softwarePreviewCard-$softwareId\"", $html);
// $this->assertContains("id=\"mappingForUser-$idUserA\"", $html);
// $this->assertContains("class=\"linkMappingTaxon\"", $html);
// $this->assertContains("id=\"linkMappingTaxon-$taxonIdA\"", $html);
// $this->assertContains("id=\"linkMappingTaxon-$taxonIdB\"", $html);
$this->assertContains("id=\"mappingForUser-$idUserA\"", $html);
$this->assertContains("class=\"linkMappingTaxon\"", $html);
$this->assertContains("id=\"linkMappingTaxon-$taxonIdA\"", $html);
$this->assertContains("id=\"linkMappingTaxon-$taxonIdB\"", $html);
// on mapping page: entry found for current user (ID-6), software ID-5 and taxon ID 3
$r = $this->checkUrlOk($testeddUrlTaxonA, ['html'], false);
......@@ -266,10 +265,10 @@ class TaxonomysSoftwaresControllerTest extends ApiIntegrationTestCase
$r = $this->checkUrlOk($userUrl, ['html'], false);
$html = $r['html']['data'];
$this->assertContains("id=\"softwarePreviewCard-$softwareId\"", $html);
// $this->assertContains("id=\"mappingForUser-$idUserA\"", $html);
// $this->assertContains("class=\"linkMappingTaxon\"", $html);
// $this->assertNotContains("id=\"linkMappingTaxon-$taxonIdA\"", $html);
// $this->assertContains("id=\"linkMappingTaxon-$taxonIdB\"", $html);
$this->assertContains("id=\"mappingForUser-$idUserA\"", $html);
$this->assertContains("class=\"linkMappingTaxon\"", $html);
$this->assertNotContains("id=\"linkMappingTaxon-$taxonIdA\"", $html);
$this->assertContains("id=\"linkMappingTaxon-$taxonIdB\"", $html);
// on mapping page: no entry for current user (ID-6), software ID-5 and taxon ID 3
$this->checkUrlRedirectToAnotherUrl($testeddUrlTaxonA, $redirectUrlTaxonA, ['html'], 301);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment