summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/jetpack_vendor/automattic/jetpack-wordads/src/dashboard/components/button/test/index.test.jsx')
-rw-r--r--plugins/jetpack/jetpack_vendor/automattic/jetpack-wordads/src/dashboard/components/button/test/index.test.jsx33
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/jetpack/jetpack_vendor/automattic/jetpack-wordads/src/dashboard/components/button/test/index.test.jsx b/plugins/jetpack/jetpack_vendor/automattic/jetpack-wordads/src/dashboard/components/button/test/index.test.jsx
new file mode 100644
index 00000000..86c8c310
--- /dev/null
+++ b/plugins/jetpack/jetpack_vendor/automattic/jetpack-wordads/src/dashboard/components/button/test/index.test.jsx
@@ -0,0 +1,33 @@
+/**
+ * @jest-environment jsdom
+ */
+
+/**
+ * External dependencies
+ */
+import React from 'react';
+import { render, screen } from '@testing-library/react';
+import '@testing-library/jest-dom';
+
+/**
+ * Internal dependencies
+ */
+import Button from 'components/button';
+
+describe( 'Button', function () {
+ const testProps = {
+ className: 'test-class',
+ };
+ it( 'can render', () => {
+ render( <Button /> );
+ expect( screen.queryByRole( 'button' ) ).toBeInTheDocument();
+ } );
+ it( 'can render compact button', () => {
+ render( <Button compact={ true } /> );
+ expect( screen.queryByRole( 'button' ).className ).toContain( 'is-compact' );
+ } );
+ it( 'can render with class name passed in', () => {
+ render( <Button { ...testProps } /> );
+ expect( screen.queryByRole( 'button' ).className ).toContain( 'test-class' );
+ } );
+} );