Skip to content

tests(react): improve webchat tests#1066

Merged
AinaVendrell merged 1 commit intomasterfrom
feat/improve-webchat-tests
Nov 9, 2020
Merged

tests(react): improve webchat tests#1066
AinaVendrell merged 1 commit intomasterfrom
feat/improve-webchat-tests

Conversation

@AinaVendrell
Copy link
Copy Markdown
Contributor

Description

  • Fix persistentMenu test
  • Add test for webchat messages
  • Create expectToHaveRoles and expectNotToHaveRoles to extract the common logic of the tests

Context

PersistentMenu test was failing because the closeLabel button has no payload, path, webviews or url

Approach taken / Explain the design

To solve the PersistentMenu error, check if the button has onClick prop

To document / Usage example

Testing

The pull request...

  • has unit tests
  • has integration tests
  • doesn't need tests because... [provide a description]

Copy link
Copy Markdown
Contributor

@vanbasten17 vanbasten17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good Aina, good work! 👏 Can you please rename tests literals to contain 'TEST:' ?

Comment thread packages/botonic-react/tests/webchat/webchat.addmessages.test.jsx
Comment thread packages/botonic-react/tests/webchat/webchat.addmessages.test.jsx Outdated
Comment thread packages/botonic-react/tests/webchat/webchat.addmessages.test.jsx Outdated
Comment thread packages/botonic-react/tests/helpers/test-utils.jsx Outdated
Comment thread packages/botonic-react/src/constants.js Outdated
Copy link
Copy Markdown
Contributor

@elozano98 elozano98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job with these test improvements! 👏 💯

Comment thread packages/botonic-react/src/constants.js Outdated
@AinaVendrell AinaVendrell force-pushed the feat/improve-webchat-tests branch from af0c8b7 to 6976f4f Compare November 6, 2020 16:21
return file
}

export function expectToHaveRoles(role, screen) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename role to roles

})
}

export function expectNotToHaveRoles(role, screen) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename role to roles

@AinaVendrell AinaVendrell force-pushed the feat/improve-webchat-tests branch from 037252b to 0cb49fb Compare November 9, 2020 08:21
@AinaVendrell AinaVendrell merged commit 769d214 into master Nov 9, 2020
@AinaVendrell AinaVendrell deleted the feat/improve-webchat-tests branch November 9, 2020 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants