首页 > 解决方案 > 如何在角度和笑话的条件下修复发现分支

问题描述

嗨,我已经在 if 条件下使用 jest 中的表单值实现了测试用例。

       if (this.accountForm.get('account')?.value === 'No' ) {
           this.router.navigateByUrl(/home);
         }else {
             this.router.navigateByUrl(/profile);
          }

测试用例代码

component.accountForm.patchValue({ ['account']: 'Yes' });

错误显示如下所示 在此处输入图像描述

标签: jestjsangular-cli

解决方案


推荐阅读