diff --git a/components/lib/button/Button.spec.js b/components/lib/button/Button.spec.js index 2cd24cc432..4f57fd9bee 100644 --- a/components/lib/button/Button.spec.js +++ b/components/lib/button/Button.spec.js @@ -1,8 +1,8 @@ import '@testing-library/jest-dom'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; -import { Button } from './Button'; - import { snapshot } from '../../test'; +import PrimeReact from '../api/PrimeReact'; +import { Button } from './Button'; describe('Button', () => { snapshot( + +`; + exports[`Button when aria-label prop is not exist aria-label prop should be equal to label prop 1`] = `
+
+`; + exports[`Button when visible is false Button return null 1`] = `
`; exports[`Button when visible is true Button render correctly 1`] = ` diff --git a/components/lib/progressbar/ProgressBar.spec.js b/components/lib/progressbar/ProgressBar.spec.js new file mode 100644 index 0000000000..2f5cc8130c --- /dev/null +++ b/components/lib/progressbar/ProgressBar.spec.js @@ -0,0 +1,20 @@ +import '@testing-library/jest-dom'; +import { render } from '@testing-library/react'; +import { snapshot } from '../../test'; +import { ProgressBar } from './ProgressBar'; + +describe('ProgressBar', () => { + snapshot(, 'default'); + snapshot(, 'value'); + snapshot(, 'hide value'); + snapshot(, 'value with unit'); + snapshot(, 'mode determinate'); + snapshot(, 'mode indeterminate'); + test('when mode is invalid throws exception', () => { + try { + const { container } = render(); + } catch (error) { + expect(error.toString().startsWith("Error: invalid is not a valid mode for the ProgressBar. Valid values are 'determinate' and 'indeterminate'")).toBeTruthy(); + } + }); +}); diff --git a/components/lib/progressbar/__snapshots__/ProgressBar.spec.js.snap b/components/lib/progressbar/__snapshots__/ProgressBar.spec.js.snap new file mode 100644 index 0000000000..a03b098241 --- /dev/null +++ b/components/lib/progressbar/__snapshots__/ProgressBar.spec.js.snap @@ -0,0 +1,121 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ProgressBar default 1`] = ` +
+
+
+
+
+`; + +exports[`ProgressBar hide value 1`] = ` +
+
+
+
+
+`; + +exports[`ProgressBar mode determinate 1`] = ` +
+
+
+
+ 20% +
+
+
+
+`; + +exports[`ProgressBar mode indeterminate 1`] = ` +
+
+
+
+
+
+
+`; + +exports[`ProgressBar value 1`] = ` +
+
+
+
+ 50% +
+
+
+
+`; + +exports[`ProgressBar value with unit 1`] = ` +
+
+
+
+ 50% +
+
+
+
+`; diff --git a/components/lib/progressspinner/ProgressSpinner.spec.js b/components/lib/progressspinner/ProgressSpinner.spec.js new file mode 100644 index 0000000000..3dab293289 --- /dev/null +++ b/components/lib/progressspinner/ProgressSpinner.spec.js @@ -0,0 +1,11 @@ +import '@testing-library/jest-dom'; +import { ProgressSpinner } from './ProgressSpinner'; + +import { snapshot } from '../../test'; + +describe('ProgressSpinner', () => { + snapshot(, 'default'); + snapshot(, 'strokeWidth'); + snapshot(, 'fill'); + snapshot(, 'animationDuration'); +}); diff --git a/components/lib/progressspinner/__snapshots__/ProgressSpinner.spec.js.snap b/components/lib/progressspinner/__snapshots__/ProgressSpinner.spec.js.snap new file mode 100644 index 0000000000..aa4478312d --- /dev/null +++ b/components/lib/progressspinner/__snapshots__/ProgressSpinner.spec.js.snap @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ProgressSpinner animationDuration 1`] = ` +
+ +
+`; + +exports[`ProgressSpinner default 1`] = ` +
+ +
+`; + +exports[`ProgressSpinner fill 1`] = ` +
+ +
+`; + +exports[`ProgressSpinner strokeWidth 1`] = ` +
+ +
+`;