There was a bug and the code was displaying `Segment succesfully
updated!` instead of `Segment succesfull added!` when the user created a
new segment.
This commit fixes this problem. The issue was that
Number(match.params.id) returns `NaN` instead of `undefined` when there
is no segment ID. So the check inside handleSave() was always calling
messages.onUpdate().
Since the segment ID was never used. I replaced it with a boolean and
renamed the variable from `segmentId` to `isNewSegment` to better
indicate how it is used.
[MAILPOET-5615]
Segments and lists were separated into different pages in a previous
commit. This commit updates the acceptance tests to reflect this change.
[MAILPOET-5392]
If the segment count calculation is fast, the
text "Calculating segment size…" might only
show for a split second.
This was causing the tests to fail
intermittently because $i->waitForText was
missing the text.
For whatever reason, adding a 2 second delay
between the button clicks and the waiting for
text step apparently made this failure much more
likely, and it was also more likely in CircleCI
than locally.
[MAILPOET-4018]