mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
Fix: add the right change
This commit is contained in:
parent
83fe430a14
commit
9dc64659b7
@ -100,40 +100,6 @@ const updateStrategyInCr = async (
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
describe.each([
|
|
||||||
[
|
|
||||||
'updateStrategy',
|
|
||||||
(segmentId: number) =>
|
|
||||||
updateStrategyInCr(randomId(), segmentId, FLAG_NAME),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'addStrategy',
|
|
||||||
(segmentId: number) => addStrategyToCr(segmentId, FLAG_NAME),
|
|
||||||
],
|
|
||||||
])('Should handle %s changes correctly', (_, addOrUpdateStrategy) => {
|
|
||||||
test.each([
|
|
||||||
['Draft', true],
|
|
||||||
['In review', true],
|
|
||||||
['Scheduled', true],
|
|
||||||
['Approved', true],
|
|
||||||
['Rejected', false],
|
|
||||||
['Cancelled', false],
|
|
||||||
['Applied', false],
|
|
||||||
])(
|
|
||||||
'Changes in %s CRs should make it %s',
|
|
||||||
async (state, expectedOutcome) => {
|
|
||||||
await createCR(state);
|
|
||||||
|
|
||||||
const segmentId = 3;
|
|
||||||
await addOrUpdateStrategy(segmentId);
|
|
||||||
|
|
||||||
expect(
|
|
||||||
await readModel.isSegmentUsedInActiveChangeRequests(segmentId),
|
|
||||||
).toBe(expectedOutcome);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
test.each([
|
test.each([
|
||||||
['Draft', true],
|
['Draft', true],
|
||||||
['In review', true],
|
['In review', true],
|
||||||
|
Loading…
Reference in New Issue
Block a user