From 0366403c83408b34a512795272df665b7937872c Mon Sep 17 00:00:00 2001
From: jaywcjlove <398188662@qq.com>
Date: Thu, 7 Oct 2021 21:42:57 +0800
Subject: [PATCH] test: Add placeholder/editable test case.
---
test/index.test.tsx | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/test/index.test.tsx b/test/index.test.tsx
index 31f708baf..6ee186b25 100644
--- a/test/index.test.tsx
+++ b/test/index.test.tsx
@@ -69,3 +69,17 @@ it('CodeMirror className', async () => {
expect(tree.props.className).toEqual('cm-theme-light test');
}
});
+
+it('CodeMirror placeholder', async () => {
+ const { findByText } = render();
+ const text = await findByText('Hello World');
+ expect(text.className).toEqual('cm-placeholder');
+ expect(text.contentEditable).toEqual('false');
+});
+
+it('CodeMirror editable', async () => {
+ const { getByRole } = render();
+ const text = getByRole('textbox');
+ expect(text.className).toEqual('cm-content');
+ expect(text.tagName).toEqual('DIV');
+});