Configure Job for "Only allow merge requests to be merged if the pipeline succeeds"

I have a pipeline that starts when I merge a merge request. I need exactly:

Only allow merge requests to be merged if the pipeline succeeds

Here: Auto-merge | GitLab

After setting the flag: https://gitlab.com/help/user/project/merge_requests/img/merge_when_pipeline_succeeds_only_if_succeeds_settings.png

I tried, the pipeline fails but the merge is successful

ther is this note in the guide:

Note:
You need to have jobs configured to enable this feature.

what configuration is it?

Thanks