Commit 7d1e770
committed
test: 💍 fix test by stubbing writeText
The hds copy button uses the browser clipboard api. The writeText
api can fail if the window is not active. This does not happen in
practice because the window has to be active to be clicked by the
user. But in tests with synthetic triggers this can fail.
Stubbing the writeText method is also how hds tests their
component:
https://github.com/hashicorp/design-system/blob/990981b5741f9a6bf28d100c330b7865ba74e506/showcase/tests/integration/components/hds/copy/button/index-test.gts#L201 parent 3e29a3b commit 7d1e770
File tree
3 files changed
+10
-1
lines changed- addons/rose
- tests/integration/components/rose/code-editor
3 files changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
57 | 60 | | |
58 | 61 | | |
| 62 | + | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments