Skip to content

Commit

Permalink
test: modify tests for changes
Browse files Browse the repository at this point in the history
  • Loading branch information
calvin-codecov committed Oct 30, 2024
1 parent 0fb7064 commit 02500b5
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/pages/RepoPage/CoverageOnboarding/OtherCI/OtherCI.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('OtherCI', () => {
expect(codecovToken).toBeInTheDocument()

const tokenValue = await screen.findAllByText(/repo-token-jkl;-7890/)
expect(tokenValue).toHaveLength(2)
expect(tokenValue).toHaveLength(1)
})
})
})
Expand Down Expand Up @@ -200,6 +200,10 @@ describe('OtherCI', () => {

const box = await screen.findByText(/upload-process/)
expect(box).toBeInTheDocument()
const instruction = await screen.findByText(
/If you are using a repo token/
)
expect(instruction).toBeInTheDocument()
})

describe('when org has upload token', () => {
Expand All @@ -210,6 +214,18 @@ describe('OtherCI', () => {
const box = await screen.findByText(/-r cool-repo/)
expect(box).toBeInTheDocument()
})

it('renders both command boxes', async () => {
setup({ hasOrgUploadToken: true })
render(<OtherCI />, { wrapper })

const commandBoxes = await screen.findAllByText(/upload-process/)
expect(commandBoxes).toHaveLength(2)
const instruction = await screen.findByText(
/If you are using an org token/
)
expect(instruction).toBeInTheDocument()
})
})

describe('when org does not have org upload token', () => {
Expand All @@ -219,6 +235,8 @@ describe('OtherCI', () => {

const box = screen.queryByText(/-r cool-repo/)
expect(box).not.toBeInTheDocument()
const instruction = screen.queryByText(/If you are using an org token/)
expect(instruction).not.toBeInTheDocument()
})
})

Expand Down

0 comments on commit 02500b5

Please sign in to comment.