Skip to content

Commit

Permalink
ENGCOM-2271: 15259 : Unable to disable without providing Industry value
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Idolov authored Oct 23, 2018
2 parents 237f531 + 5e4f717 commit 94a06c0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions app/code/Magento/Analytics/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
<source_model>Magento\Analytics\Model\Config\Source\Vertical</source_model>
<backend_model>Magento\Analytics\Model\Config\Backend\Vertical</backend_model>
<frontend_model>Magento\Analytics\Block\Adminhtml\System\Config\Vertical</frontend_model>
<depends>
<field id="analytics/general/enabled">1</field>
</depends>
</field>
<field id="additional_comment" translate="label comment" type="label" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
<label><![CDATA[<strong>Get more insights from Magento Business Intelligence</strong>]]></label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,17 @@ public function getAnalyticsStatus()

/**
* @param string $vertical
* @return array|string
* @return $this
*/
public function setAnalyticsVertical($vertical)
{
return $this->_rootElement->find($this->analyticsVertical, Locator::SELECTOR_CSS, 'select')
->setValue($vertical);

$element = $this->_rootElement->find($this->analyticsVertical, Locator::SELECTOR_CSS, 'select');
if ($element->isVisible()) {
$element->setValue($vertical);
}

return $this;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public function processAssert(ConfigAnalytics $configAnalytics, OpenAnalyticsCon
'Subscription status: Disabled',
'Magento Advanced Reporting service subscription status is not disabled.'
);
\PHPUnit_Framework_Assert::assertFalse(
(bool)$configAnalytics->getAnalyticsForm()->getAnalyticsVerticalScope(),
'Industry Data is visible.'
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ public function processAssert(ConfigAnalytics $configAnalytics, OpenAnalyticsCon
(bool)$configAnalytics->getAnalyticsForm()->isAnalyticsEnabled(),
'Magento Advanced Reporting service is not enabled.'
);

\PHPUnit_Framework_Assert::assertEquals(
$configAnalytics->getAnalyticsForm()->getAnalyticsStatus(),
'Subscription status: Pending',
'Magento Advanced Reporting service subscription status is not pending.'
);
\PHPUnit_Framework_Assert::assertTrue(
(bool)$configAnalytics->getAnalyticsForm()->getAnalyticsVerticalScope(),
'Industry Data is not visible.'
);
}

/**
Expand Down

0 comments on commit 94a06c0

Please sign in to comment.