The employer cannot dismiss a pregnant woman. If, however, you have an employment contract for a definite period (e.g. one year), the employer is not obliged to extend the employment relationship. The relationship ends as the employment contract expires. In this case, you are covered by the protection period of 180 days, i.e. if you start your maternity leave within 180 days since the termination of the employment relationship, you get a compensation of your salary (in the form of sickness benefit or maternity benefit).
Important! If you just started a new job and are in the probationary period, you are not protected by the protection period and the employer is not obliged to inform you about the reason for terminating your employment relationship.