Skip to content

Commit

Permalink
Add an empty component test for clipboard API #103
Browse files Browse the repository at this point in the history
  • Loading branch information
mkudamatsu committed Apr 14, 2020
1 parent 0ebd2aa commit 2932dad
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/GetCSS.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ test('renders correctly', () => {
p:not(:first-child) {
margin-top: undefinedpx;
}
</code>
</pre>
<button
Expand Down Expand Up @@ -434,7 +434,7 @@ test('renders correctly', () => {
id="extraText"
>
Alternatively, consider using the browsers that support the "click to copy into clipboard" feature: Edge (version 79 or later), Chrome (76 or later), Opera (63 or later). See
<a
class="c13"
href="https://caniuse.com/#feat=mdn-api_fontface"
Expand All @@ -444,7 +444,7 @@ test('renders correctly', () => {
for the latest list of supporting browsers.
</p>
</section>
</main>
</div>
`);
Expand Down Expand Up @@ -496,6 +496,11 @@ test('renders props correctly', () => {
expect(getByTestId('cssCode')).toHaveTextContent(mockNewProps.marginTop);
});

test('Clicking the button copys the CSS code into the user clipboard', async () => {
// I'm not sure how we can access to the content of the clipboard.
// navigator.clipboard.readText() does not work.
});

test('is accessible', async () => {
const {container} = render(<GetCSS />);
const results = await axe(container);
Expand Down

0 comments on commit 2932dad

Please sign in to comment.