Commit b36a3d2e authored by Jason Goodman's avatar Jason Goodman Committed by Andrew Fontaine

Improve within_strategy_row spec helper

Add js css class to decouple helper from DOM structure
parent 936c99b2
......@@ -305,7 +305,7 @@ export default {
</div>
</div>
</div>
<template v-if="filteredStrategies.length > 0">
<div v-if="filteredStrategies.length > 0" data-testid="feature-flag-strategies">
<strategy
v-for="(strategy, index) in filteredStrategies"
:key="strategy.id"
......@@ -316,7 +316,7 @@ export default {
@change="onFormStrategyChange($event, index)"
@delete="deleteStrategy(strategy)"
/>
</template>
</div>
<div v-else class="flex justify-content-center border-top py-4 w-100">
<span>{{ $options.translations.noStrategiesText }}</span>
</div>
......
......@@ -33,7 +33,7 @@ module FeatureFlagHelpers
end
def within_strategy_row(index)
within ".feature-flags-form > fieldset > div:nth-child(#{index + 3})" do
within ".feature-flags-form > fieldset > div[data-testid='feature-flag-strategies'] > div:nth-child(#{index})" do
yield
end
end
......
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