Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1cbbb5f commit 3b2d2f6Copy full SHA for 3b2d2f6
src/tests/components/MessageForm.test.js
@@ -34,4 +34,19 @@ describe("MessageForm", () => {
34
`${text.length} / ${MAX_MESSAGE_TEXT_LENGTH}`
35
);
36
});
37
+
38
+ test("disables tweet button when text is empty", () => {
39
+ const utils = render(<MessageForm user={USER} />);
40
+ const button = utils.getByRole("tweet");
41
+ expect(button.disabled).toBe(true);
42
+ });
43
44
+ test("updates with user typing", () => {
45
+ const text = "A";
46
47
+ const input = utils.getByLabelText("message-form");
48
+ fireEvent.change(input, { target: { value: text } });
49
50
+ expect(button.disabled).toBe(false);
51
52
0 commit comments