反应测试库功能测试以启动另一个赛普拉斯测试

时间:2020-10-22 18:55:20

标签: cypress react-testing-library

也许设置不佳,但是我从阅读的第一个TDD book中中学到了一些东西。

是否有可能会有一个大型的RTL functional.test.tsx基本上贯穿用户故事,从而触发了许多其他测试和/或命令?

具体说来是可行还是理想:

functional.test.tsx:

import React from 'react'
import { render, fireEvent, screen } from '../testUtils'
import { Home } from '../../pages/index'
import '@testing-library/jest-dom/extend-expect'

//TDD Books: User Story
describe('Home page', () => {
  //Bob logs into TDD Books using Google (or Github).
  test('login works', () => {
   
     *** run: cypress run --spec "cypress/integration/login.js" ***
     expect(cypress_login).toBe('passed')         
  
  })  

  //Bob can see either his book shelf he added from earlier or it's empty waiting for books to be added.

   ...

我之所以如此,是因为NextAuth.js recommends使用赛普拉斯来测试社交登录。

0 个答案:

没有答案