>As the employee submitting your notice - have your ducks-in-a-row before turning in your notice as it maximizes your chance for a smooth exit.
Right. If you have vesting events, expected bonus payouts, etc. wait until after those happen before giving notice as opposed to just assuming the employer will keep you on the payroll as an employee for those two weeks.
If you gave two weeks notice and got terminated immediately to prevent you from benefiting from something that would have vested in that two week period, you have an excellent legal case. Very few businesses of any reasonable size would pull that stunt, it isn't worth the headache. Some very small businesses might try it, because they may not have competent legal counsel to warn them away.