Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add page tests (#1983)
Dominik Żegleń8e08f0173ae1
diff --git a/saleor/static/dashboard-next/page/components/PageBaseForm/PageBaseForm.test.tsx b/saleor/static/dashboard-next/page/components/PageBaseForm/PageBaseForm.test.tsxnew file mode 100644index 0000000000..88eb65f265--- /dev/null+++ b/saleor/static/dashboard-next/page/components/PageBaseForm/PageBaseForm.test.tsx@@ -0,0 +1,47 @@+import * as React from "react";+import * as renderer from "react-test-renderer";++import PageBaseForm from "./";++const page = {+ availableOn: "2018-03-20T16:39:08.850105+00:00",+ content:+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt.",+ isVisible: true,+ slug: "lorem-ipsum-dolor",+ title: "Lorem ipsum"+};++describe("<PageBaseForm />", () => {+ it("renders without 'created' property", () => {+ const component = renderer.create(<PageBaseForm {...page} />);+ expect(component).toMatchSnapshot();+ });+ it("renders with 'created' property", () => {+ const created = "2018-03-20T16:39:08.850105+00:00";+ const component = renderer.create(+ <PageBaseForm {...page} created={created} />+ );+ expect(component).toMatchSnapshot();+ });+ it("renders errors", () => {+ const errors = [+ {+ field: "slug",+ message: "To pole jest wymagane."+ },+ {+ field: "title",+ message: "To pole jest wymagane."+ },+ {+ field: "content",+ message: "To pole jest wymagane."+ }+ ];+ const component = renderer.create(+ <PageBaseForm {...page} errors={errors} />+ );+ expect(component).toMatchSnapshot();+ });+});diff --git a/saleor/static/dashboard-next/page/components/PageBaseForm.tsx b/saleor/static/dashboard-next/page/components/PageBaseForm/PageBaseForm.tsxsimilarity index 90%rename from saleor/static/dashboard-next/page/components/PageBaseForm.tsxrename to saleor/static/dashboard-next/page/components/PageBaseForm/PageBaseForm.tsxindex 47dc718fb5..462efb8734 100644--- a/saleor/static/dashboard-next/page/components/PageBaseForm.tsx+++ b/saleor/static/dashboard-next/page/components/PageBaseForm/PageBaseForm.tsx@@ -7,12 +7,11 @@ import Toolbar from "material-ui/Toolbar";import Typography from "material-ui/Typography";import * as React from "react";-import ControlledCheckbox from "../../components/ControlledCheckbox";-import FormSpacer from "../../components/FormSpacer";-import RichTextEditor from "../../components/RichTextEditor";-import i18n from "../../i18n";+import ControlledCheckbox from "../../../components/ControlledCheckbox";+import FormSpacer from "../../../components/FormSpacer";+import RichTextEditor from "../../../components/RichTextEditor";+import i18n from "../../../i18n";-// FIXME: Change nameinterface PageBaseFormComponentProps {availableOn: string;content: string;@@ -47,10 +46,12 @@ export const PageBaseForm = decorate<PageBaseFormComponentProps>(isVisible,onChange}) => {- const errorList: { [key: string]: string } = errors.reduce((acc, curr) => {- acc[curr.field] = curr.message;- return acc;- }, {});+ const errorList: { [key: string]: string } = errors+ ? errors.reduce((acc, curr) => {+ acc[curr.field] = curr.message;+ return acc;+ }, {})+ : {};return (<CardContent><Grid container spacing={16}>diff --git a/saleor/static/dashboard-next/page/components/PageBaseForm/__snapshots__/PageBaseForm.test.tsx.snap b/saleor/static/dashboard-next/page/components/PageBaseForm/__snapshots__/PageBaseForm.test.tsx.snapnew file mode 100644index 0000000000..8e98bfd76a--- /dev/null+++ b/saleor/static/dashboard-next/page/components/PageBaseForm/__snapshots__/PageBaseForm.test.tsx.snap@@ -0,0 +1,873 @@+// Jest Snapshot v1, https://goo.gl/fbAQLP++exports[`<PageBaseForm /> renders errors 1`] = `+<div+ className="MuiCardContent-root-3"+>+ <div+ className="MuiGrid-typeContainer-4 MuiGrid-spacing-xs-16-26"+ >+ <div+ className="MuiGrid-typeItem-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-9-64"+ >+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-94 MuiFormControl-fullWidth-97"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-104 MuiFormLabel-error-107 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ htmlFor={undefined}+ >+ Title+ </label>+ <div+ className="MuiInput-root-110 MuiInput-error-115 MuiInput-fullWidth-117 MuiInput-formControl-111 MuiInput-underline-114"+ >+ <input+ aria-invalid={true}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={true}+ className="MuiInput-input-118"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="title"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="text"+ value="Lorem ipsum"+ />+ </div>+ <p+ className="MuiFormHelperText-root-128 MuiFormHelperText-error-129"+ id={undefined}+ >+ To pole jest wymagane.+ </p>+ </div>+ <div+ className="Component-spacer-124"+ />+ <div+ className="MuiFormControl-root-94"+ onBlur={[Function]}+ onFocus={[Function]}+ style={+ Object {+ "width": "100%",+ }+ }+ >+ <label+ className="MuiFormLabel-root-104 MuiFormLabel-error-107 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ >+ Content+ </label>+ <div+ className="MuiInput-root-110 MuiInput-error-115 MuiInput-fullWidth-117 MuiInput-formControl-111 MuiInput-multiline-116 MuiInput-underline-114"+ >+ <div+ className="MuiTextarea-root-125"+ style={+ Object {+ "height": 19,+ }+ }+ >+ <textarea+ aria-hidden="true"+ className="MuiTextarea-shadow-127 MuiTextarea-textarea-126"+ readOnly={true}+ rows="1"+ tabIndex={-1}+ value=""+ />+ <textarea+ aria-hidden="true"+ className="MuiTextarea-shadow-127 MuiTextarea-textarea-126"+ defaultValue={undefined}+ readOnly={true}+ rows={1}+ tabIndex={-1}+ value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."+ />+ <textarea+ aria-invalid={true}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiTextarea-textarea-126 MuiInput-input-118 MuiInput-inputMultiline-121"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="content"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={1}+ type="text"+ value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."+ />+ </div>+ </div>+ <p+ className="MuiFormHelperText-root-128 MuiFormHelperText-error-129"+ >+ To pole jest wymagane.+ </p>+ </div>+ </div>+ <div+ className="MuiGrid-typeItem-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-3-58"+ >+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-94 MuiFormControl-fullWidth-97"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-104 MuiFormLabel-error-107 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ htmlFor={undefined}+ >+ Slug+ </label>+ <div+ className="MuiInput-root-110 MuiInput-error-115 MuiInput-fullWidth-117 MuiInput-formControl-111 MuiInput-underline-114"+ >+ <input+ aria-invalid={true}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiInput-input-118"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="slug"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="text"+ value="lorem-ipsum-dolor"+ />+ </div>+ <p+ className="MuiFormHelperText-root-128 MuiFormHelperText-error-129"+ id={undefined}+ >+ To pole jest wymagane.+ </p>+ </div>+ <div+ className="Component-spacer-124"+ />+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-94"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-104 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ htmlFor={undefined}+ >+ Available on+ </label>+ <div+ className="MuiInput-root-110 MuiInput-formControl-111 MuiInput-underline-114"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiInput-input-118 MuiInput-inputType-122"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="availableOn"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="date"+ value="2018-03-20T16:39:08.850105+00:00"+ />+ </div>++ </div>+ <div+ className="Component-spacer-124"+ />+ <div+ className="Component-spacer-124"+ />+ <label+ className="MuiFormControlLabel-root-132"+ >+ <span+ className="MuiButtonBase-root-151 MuiIconButton-root-145 MuiSwitchBase-root-140 MuiSwitchBase-default-142 MuiCheckbox-default-135 MuiSwitchBase-checked-143 MuiCheckbox-checked-136 MuiCheckbox-checkedSecondary-138"+ onBlur={[Function]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ role={undefined}+ tabIndex={null}+ >+ <span+ className="MuiIconButton-label-150"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-154"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"+ />+ </svg>+ <input+ checked={true}+ className="MuiSwitchBase-input-141"+ disabled={undefined}+ id={undefined}+ name="isVisible"+ onChange={[Function]}+ tabIndex={undefined}+ type="checkbox"+ value={undefined}+ />+ </span>+ <span+ className="MuiTouchRipple-root-160"+ />+ </span>+ <span+ className="MuiTypography-root-167 MuiTypography-body1-176 MuiFormControlLabel-label-134"+ >+ Published+ </span>+ </label>+ </div>+ </div>+</div>+`;++exports[`<PageBaseForm /> renders with 'created' property 1`] = `+<div+ className="MuiCardContent-root-3"+>+ <div+ className="MuiGrid-typeContainer-4 MuiGrid-spacing-xs-16-26"+ >+ <div+ className="MuiGrid-typeItem-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-9-64"+ >+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-94 MuiFormControl-fullWidth-97 Component-addHelperTextPadding-1"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-104 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ htmlFor={undefined}+ >+ Title+ </label>+ <div+ className="MuiInput-root-110 MuiInput-fullWidth-117 MuiInput-formControl-111 MuiInput-underline-114"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={true}+ className="MuiInput-input-118"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="title"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="text"+ value="Lorem ipsum"+ />+ </div>++ </div>+ <div+ className="Component-spacer-124"+ />+ <div+ className="MuiFormControl-root-94"+ onBlur={[Function]}+ onFocus={[Function]}+ style={+ Object {+ "width": "100%",+ }+ }+ >+ <label+ className="MuiFormLabel-root-104 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ >+ Content+ </label>+ <div+ className="MuiInput-root-110 MuiInput-fullWidth-117 MuiInput-formControl-111 MuiInput-multiline-116 MuiInput-underline-114"+ >+ <div+ className="MuiTextarea-root-125"+ style={+ Object {+ "height": 19,+ }+ }+ >+ <textarea+ aria-hidden="true"+ className="MuiTextarea-shadow-127 MuiTextarea-textarea-126"+ readOnly={true}+ rows="1"+ tabIndex={-1}+ value=""+ />+ <textarea+ aria-hidden="true"+ className="MuiTextarea-shadow-127 MuiTextarea-textarea-126"+ defaultValue={undefined}+ readOnly={true}+ rows={1}+ tabIndex={-1}+ value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."+ />+ <textarea+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiTextarea-textarea-126 MuiInput-input-118 MuiInput-inputMultiline-121"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="content"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={1}+ type="text"+ value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."+ />+ </div>+ </div>+ <p+ className="MuiFormHelperText-root-128"+ >+ Select text to enable text-formatting tools.+ </p>+ </div>+ </div>+ <div+ className="MuiGrid-typeItem-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-3-58"+ >+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-94 MuiFormControl-fullWidth-97"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-104 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ htmlFor={undefined}+ >+ Slug+ </label>+ <div+ className="MuiInput-root-110 MuiInput-fullWidth-117 MuiInput-formControl-111 MuiInput-underline-114"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiInput-input-118"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="slug"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="text"+ value="lorem-ipsum-dolor"+ />+ </div>+ <p+ className="MuiFormHelperText-root-128"+ id={undefined}+ >+ Slug is being used to create page URL+ </p>+ </div>+ <div+ className="Component-spacer-124"+ />+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-94"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-104 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ htmlFor={undefined}+ >+ Available on+ </label>+ <div+ className="MuiInput-root-110 MuiInput-formControl-111 MuiInput-underline-114"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiInput-input-118 MuiInput-inputType-122"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="availableOn"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="date"+ value="2018-03-20T16:39:08.850105+00:00"+ />+ </div>++ </div>+ <div+ className="Component-spacer-124"+ />+ <p+ className="MuiTypography-root-167 MuiTypography-body1-176"+ >+ Created at:+ 2018-03-20T16:39:08.850105+00:00+ </p>+ <div+ className="Component-spacer-124"+ />+ <label+ className="MuiFormControlLabel-root-132"+ >+ <span+ className="MuiButtonBase-root-151 MuiIconButton-root-145 MuiSwitchBase-root-140 MuiSwitchBase-default-142 MuiCheckbox-default-135 MuiSwitchBase-checked-143 MuiCheckbox-checked-136 MuiCheckbox-checkedSecondary-138"+ onBlur={[Function]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ role={undefined}+ tabIndex={null}+ >+ <span+ className="MuiIconButton-label-150"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-154"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"+ />+ </svg>+ <input+ checked={true}+ className="MuiSwitchBase-input-141"+ disabled={undefined}+ id={undefined}+ name="isVisible"+ onChange={[Function]}+ tabIndex={undefined}+ type="checkbox"+ value={undefined}+ />+ </span>+ <span+ className="MuiTouchRipple-root-160"+ />+ </span>+ <span+ className="MuiTypography-root-167 MuiTypography-body1-176 MuiFormControlLabel-label-134"+ >+ Published+ </span>+ </label>+ </div>+ </div>+</div>+`;++exports[`<PageBaseForm /> renders without 'created' property 1`] = `+<div+ className="MuiCardContent-root-3"+>+ <div+ className="MuiGrid-typeContainer-4 MuiGrid-spacing-xs-16-26"+ >+ <div+ className="MuiGrid-typeItem-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-9-64"+ >+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-94 MuiFormControl-fullWidth-97 Component-addHelperTextPadding-1"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-104 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ htmlFor={undefined}+ >+ Title+ </label>+ <div+ className="MuiInput-root-110 MuiInput-fullWidth-117 MuiInput-formControl-111 MuiInput-underline-114"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={true}+ className="MuiInput-input-118"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="title"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="text"+ value="Lorem ipsum"+ />+ </div>++ </div>+ <div+ className="Component-spacer-124"+ />+ <div+ className="MuiFormControl-root-94"+ onBlur={[Function]}+ onFocus={[Function]}+ style={+ Object {+ "width": "100%",+ }+ }+ >+ <label+ className="MuiFormLabel-root-104 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ >+ Content+ </label>+ <div+ className="MuiInput-root-110 MuiInput-fullWidth-117 MuiInput-formControl-111 MuiInput-multiline-116 MuiInput-underline-114"+ >+ <div+ className="MuiTextarea-root-125"+ style={+ Object {+ "height": 19,+ }+ }+ >+ <textarea+ aria-hidden="true"+ className="MuiTextarea-shadow-127 MuiTextarea-textarea-126"+ readOnly={true}+ rows="1"+ tabIndex={-1}+ value=""+ />+ <textarea+ aria-hidden="true"+ className="MuiTextarea-shadow-127 MuiTextarea-textarea-126"+ defaultValue={undefined}+ readOnly={true}+ rows={1}+ tabIndex={-1}+ value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."+ />+ <textarea+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiTextarea-textarea-126 MuiInput-input-118 MuiInput-inputMultiline-121"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="content"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={1}+ type="text"+ value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."+ />+ </div>+ </div>+ <p+ className="MuiFormHelperText-root-128"+ >+ Select text to enable text-formatting tools.+ </p>+ </div>+ </div>+ <div+ className="MuiGrid-typeItem-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-3-58"+ >+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-94 MuiFormControl-fullWidth-97"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-104 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ htmlFor={undefined}+ >+ Slug+ </label>+ <div+ className="MuiInput-root-110 MuiInput-fullWidth-117 MuiInput-formControl-111 MuiInput-underline-114"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiInput-input-118"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="slug"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="text"+ value="lorem-ipsum-dolor"+ />+ </div>+ <p+ className="MuiFormHelperText-root-128"+ id={undefined}+ >+ Slug is being used to create page URL+ </p>+ </div>+ <div+ className="Component-spacer-124"+ />+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-94"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-104 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"+ data-shrink={true}+ htmlFor={undefined}+ >+ Available on+ </label>+ <div+ className="MuiInput-root-110 MuiInput-formControl-111 MuiInput-underline-114"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiInput-input-118 MuiInput-inputType-122"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="availableOn"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="date"+ value="2018-03-20T16:39:08.850105+00:00"+ />+ </div>++ </div>+ <div+ className="Component-spacer-124"+ />+ <div+ className="Component-spacer-124"+ />+ <label+ className="MuiFormControlLabel-root-132"+ >+ <span+ className="MuiButtonBase-root-151 MuiIconButton-root-145 MuiSwitchBase-root-140 MuiSwitchBase-default-142 MuiCheckbox-default-135 MuiSwitchBase-checked-143 MuiCheckbox-checked-136 MuiCheckbox-checkedSecondary-138"+ onBlur={[Function]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ role={undefined}+ tabIndex={null}+ >+ <span+ className="MuiIconButton-label-150"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-154"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"+ />+ </svg>+ <input+ checked={true}+ className="MuiSwitchBase-input-141"+ disabled={undefined}+ id={undefined}+ name="isVisible"+ onChange={[Function]}+ tabIndex={undefined}+ type="checkbox"+ value={undefined}+ />+ </span>+ <span+ className="MuiTouchRipple-root-160"+ />+ </span>+ <span+ className="MuiTypography-root-167 MuiTypography-body1-176 MuiFormControlLabel-label-134"+ >+ Published+ </span>+ </label>+ </div>+ </div>+</div>+`;diff --git a/saleor/static/dashboard-next/page/components/PageBaseForm/index.ts b/saleor/static/dashboard-next/page/components/PageBaseForm/index.tsnew file mode 100644index 0000000000..7015a74050--- /dev/null+++ b/saleor/static/dashboard-next/page/components/PageBaseForm/index.ts@@ -0,0 +1,2 @@+export { default } from "./PageBaseForm";+export * from "./PageBaseForm";diff --git a/saleor/static/dashboard-next/page/components/PageFilters/PageFilters.test.tsx b/saleor/static/dashboard-next/page/components/PageFilters/PageFilters.test.tsxnew file mode 100644index 0000000000..0a596a4281--- /dev/null+++ b/saleor/static/dashboard-next/page/components/PageFilters/PageFilters.test.tsx@@ -0,0 +1,28 @@+import * as React from "react";+import * as renderer from "react-test-renderer";++import PageFilters from "./";++const pageFilters = {+ title: "title",+ url: "url"+};++describe("<PageFilters />", () => {+ it("renders without initial state", () => {+ const component = renderer.create(+ <PageFilters handleClear={jest.fn()} handleSubmit={jest.fn()} />+ );+ expect(component).toMatchSnapshot();+ });+ it("renders with initial state", () => {+ const component = renderer.create(+ <PageFilters+ formState={pageFilters}+ handleClear={jest.fn()}+ handleSubmit={jest.fn()}+ />+ );+ expect(component).toMatchSnapshot();+ });+});diff --git a/saleor/static/dashboard-next/page/components/PageFilters.tsx b/saleor/static/dashboard-next/page/components/PageFilters/PageFilters.tsxsimilarity index 89%rename from saleor/static/dashboard-next/page/components/PageFilters.tsxrename to saleor/static/dashboard-next/page/components/PageFilters/PageFilters.tsxindex 0f0ba84abb..7e022c6abf 100644--- a/saleor/static/dashboard-next/page/components/PageFilters.tsx+++ b/saleor/static/dashboard-next/page/components/PageFilters/PageFilters.tsx@@ -1,9 +1,9 @@import TextField from "material-ui/TextField";import * as React from "react";-import FilterCard from "../../components/FilterCard";-import FormSpacer from "../../components/FormSpacer";-import i18n from "../../i18n";+import FilterCard from "../../../components/FilterCard";+import FormSpacer from "../../../components/FormSpacer";+import i18n from "../../../i18n";interface PageFiltersState {title: string;@@ -12,7 +12,10 @@ interface PageFiltersState {}interface PageFiltersProps {- formState?: PageFiltersState;+ formState?: {+ title: string;+ url: string;+ };handleClear();handleSubmit(formState: any);}diff --git a/saleor/static/dashboard-next/page/components/PageFilters/__snapshots__/PageFilters.test.tsx.snap b/saleor/static/dashboard-next/page/components/PageFilters/__snapshots__/PageFilters.test.tsx.snapnew file mode 100644index 0000000000..f28dd5b1a2--- /dev/null+++ b/saleor/static/dashboard-next/page/components/PageFilters/__snapshots__/PageFilters.test.tsx.snap@@ -0,0 +1,299 @@+// Jest Snapshot v1, https://goo.gl/fbAQLP++exports[`<PageFilters /> renders with initial state 1`] = `+<div+ className="MuiPaper-root-1 MuiPaper-elevation2-5 MuiPaper-rounded-2"+>+ <form>+ <div+ className="MuiCardHeader-root-28"+ >+ <div+ className="MuiCardHeader-content-31"+ >+ <span+ className="MuiTypography-root-34 MuiTypography-headline-39 MuiCardHeader-title-32"+ >+ Filters+ </span>+ </div>+ <div+ className="MuiCardHeader-action-30"+ >+ <button+ className="MuiButtonBase-root-64 MuiIconButton-root-58"+ disabled={false}+ onBlur={[Function]}+ onClick={[Function]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ tabIndex="0"+ type="button"+ >+ <span+ className="MuiIconButton-label-63"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-67"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"+ />+ </svg>+ </span>+ <span+ className="MuiTouchRipple-root-73"+ />+ </button>+ </div>+ </div>+ <div+ className="MuiCardContent-root-80"+ >+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-81 MuiFormControl-fullWidth-84"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-91 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89 MuiInputLabel-shrink-88"+ data-shrink={true}+ htmlFor={undefined}+ >+ Title+ </label>+ <div+ className="MuiInput-root-97 MuiInput-fullWidth-104 MuiInput-formControl-98 MuiInput-underline-101"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiInput-input-105"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="title"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="text"+ value="title"+ />+ </div>+ </div>+ <div+ className="Component-spacer-111"+ />+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-81 MuiFormControl-fullWidth-84"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-91 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89 MuiInputLabel-shrink-88"+ data-shrink={true}+ htmlFor={undefined}+ >+ Url+ </label>+ <div+ className="MuiInput-root-97 MuiInput-fullWidth-104 MuiInput-formControl-98 MuiInput-underline-101"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiInput-input-105"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="url"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="text"+ value="url"+ />+ </div>+ </div>+ </div>+ </form>+</div>+`;++exports[`<PageFilters /> renders without initial state 1`] = `+<div+ className="MuiPaper-root-1 MuiPaper-elevation2-5 MuiPaper-rounded-2"+>+ <form>+ <div+ className="MuiCardHeader-root-28"+ >+ <div+ className="MuiCardHeader-content-31"+ >+ <span+ className="MuiTypography-root-34 MuiTypography-headline-39 MuiCardHeader-title-32"+ >+ Filters+ </span>+ </div>+ <div+ className="MuiCardHeader-action-30"+ >+ <button+ className="MuiButtonBase-root-64 MuiIconButton-root-58"+ disabled={false}+ onBlur={[Function]}+ onClick={[Function]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ tabIndex="0"+ type="button"+ >+ <span+ className="MuiIconButton-label-63"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-67"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"+ />+ </svg>+ </span>+ <span+ className="MuiTouchRipple-root-73"+ />+ </button>+ </div>+ </div>+ <div+ className="MuiCardContent-root-80"+ >+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-81 MuiFormControl-fullWidth-84"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-91 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89"+ data-shrink={false}+ htmlFor={undefined}+ >+ Title+ </label>+ <div+ className="MuiInput-root-97 MuiInput-fullWidth-104 MuiInput-formControl-98 MuiInput-underline-101"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiInput-input-105"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="title"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="text"+ value=""+ />+ </div>+ </div>+ <div+ className="Component-spacer-111"+ />+ <div+ aria-describedby={undefined}+ className="MuiFormControl-root-81 MuiFormControl-fullWidth-84"+ onBlur={[Function]}+ onFocus={[Function]}+ >+ <label+ className="MuiFormLabel-root-91 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89"+ data-shrink={false}+ htmlFor={undefined}+ >+ Url+ </label>+ <div+ className="MuiInput-root-97 MuiInput-fullWidth-104 MuiInput-formControl-98 MuiInput-underline-101"+ >+ <input+ aria-invalid={false}+ aria-required={false}+ autoComplete={undefined}+ autoFocus={undefined}+ className="MuiInput-input-105"+ defaultValue={undefined}+ disabled={false}+ id={undefined}+ name="url"+ onBlur={[Function]}+ onChange={[Function]}+ onFocus={[Function]}+ onKeyDown={undefined}+ onKeyUp={undefined}+ placeholder={undefined}+ readOnly={undefined}+ required={undefined}+ rows={undefined}+ type="text"+ value=""+ />+ </div>+ </div>+ </div>+ </form>+</div>+`;diff --git a/saleor/static/dashboard-next/page/components/PageFilters/index.ts b/saleor/static/dashboard-next/page/components/PageFilters/index.tsnew file mode 100644index 0000000000..a5db9b15f5--- /dev/null+++ b/saleor/static/dashboard-next/page/components/PageFilters/index.ts@@ -0,0 +1,2 @@+export { default } from "./PageFilters";+export * from "./PageFilters";diff --git a/saleor/static/dashboard-next/page/components/PageList/PageList.test.tsx b/saleor/static/dashboard-next/page/components/PageList/PageList.test.tsxnew file mode 100644index 0000000000..3fdc9f72f0--- /dev/null+++ b/saleor/static/dashboard-next/page/components/PageList/PageList.test.tsx@@ -0,0 +1,110 @@+import * as React from "react";+import { MemoryRouter } from "react-router-dom";+import * as renderer from "react-test-renderer";++import PageList from "./";++const pageList = [+ {+ cursor: "12345678",+ node: {+ id: "abcd",+ isVisible: true,+ slug: "lorem-ipsum-dolor",+ title: "Lorem ipsum"+ }+ },+ {+ cursor: "12345678",+ node: {+ id: "abcde",+ isVisible: true,+ slug: "lorem-ipsum-consectetur",+ title: "Pellentesque habitant morbi tristique senectus"+ }+ },+ {+ cursor: "12345678",+ node: {+ id: "abcdef",+ isVisible: true,+ slug: "lorem-ipsum-amet",+ title: "Pellentesque metus turpis"+ }+ },+ {+ cursor: "12345678",+ node: {+ id: "abcdefg",+ isVisible: true,+ slug: "lorem-ipsum-sit",+ title: "Nulla blandit ut lectus at placerat"+ }+ }+];++describe("<PageList />", () => {+ it("renders while data is loading", () => {+ const component = renderer.create(+ <MemoryRouter>+ <PageList+ loading={true}+ handlePreviousPage={jest.fn()}+ handleNextPage={jest.fn()}+ pages={[]}+ editPageUrl={jest.fn()}+ showPageUrl={jest.fn()}+ pageInfo={{+ endCursor: "",+ hasNextPage: false,+ hasPreviousPage: false,+ startCursor: ""+ }}+ />+ </MemoryRouter>+ );+ expect(component).toMatchSnapshot();+ });+ it("renders when data is fully loaded", () => {+ const component = renderer.create(+ <MemoryRouter>+ <PageList+ loading={true}+ handlePreviousPage={jest.fn()}+ handleNextPage={jest.fn()}+ pages={pageList}+ editPageUrl={jest.fn()}+ showPageUrl={jest.fn()}+ pageInfo={{+ endCursor: "",+ hasNextPage: false,+ hasPreviousPage: false,+ startCursor: ""+ }}+ />+ </MemoryRouter>+ );+ expect(component).toMatchSnapshot();+ });+ it("renders when category list is empty", () => {+ const component = renderer.create(+ <MemoryRouter>+ <PageList+ loading={true}+ handlePreviousPage={jest.fn()}+ handleNextPage={jest.fn()}+ pages={[]}+ editPageUrl={jest.fn()}+ showPageUrl={jest.fn()}+ pageInfo={{+ endCursor: "",+ hasNextPage: false,+ hasPreviousPage: false,+ startCursor: ""+ }}+ />+ </MemoryRouter>+ );+ expect(component).toMatchSnapshot();+ });+});diff --git a/saleor/static/dashboard-next/page/components/PageListComponent.tsx b/saleor/static/dashboard-next/page/components/PageList/PageList.tsxsimilarity index 94%rename from saleor/static/dashboard-next/page/components/PageListComponent.tsxrename to saleor/static/dashboard-next/page/components/PageList/PageList.tsxindex b85c26aabc..6059f3201b 100644--- a/saleor/static/dashboard-next/page/components/PageListComponent.tsx+++ b/saleor/static/dashboard-next/page/components/PageList/PageList.tsx@@ -12,10 +12,10 @@ import Table, {import * as React from "react";import { Link } from "react-router-dom";-import Skeleton from "../../components/Skeleton";-import TablePagination from "../../components/TablePagination";-import { PageListQuery } from "../../gql-types";-import i18n from "../../i18n";+import Skeleton from "../../../components/Skeleton";+import TablePagination from "../../../components/TablePagination";+import { PageListQuery } from "../../../gql-types";+import i18n from "../../../i18n";interface PageListComponentProps {pages: PageListQuery["pages"]["edges"];diff --git a/saleor/static/dashboard-next/page/components/PageList/__snapshots__/PageList.test.tsx.snap b/saleor/static/dashboard-next/page/components/PageList/__snapshots__/PageList.test.tsx.snapnew file mode 100644index 0000000000..f0fec929ad--- /dev/null+++ b/saleor/static/dashboard-next/page/components/PageList/__snapshots__/PageList.test.tsx.snap@@ -0,0 +1,496 @@+// Jest Snapshot v1, https://goo.gl/fbAQLP++exports[`<PageList /> renders when category list is empty 1`] = `+<table+ className="MuiTable-root-3"+>+ <thead+ className="MuiTableHead-root-4"+ >+ <tr+ className="MuiTableRow-root-5 MuiTableRow-head-6"+ >+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11"+ scope="col"+ >+ Name+ </th>+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11"+ scope="col"+ >+ Url+ </th>+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11"+ scope="col"+ >+ Visibility+ </th>+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11 Component-textRight-2"+ scope="col"+ >+ Actions+ </th>+ </tr>+ </thead>+ <tfoot>+ <tr+ className="MuiTableRow-root-5 MuiTableRow-footer-7"+ >+ <td+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-footer-13 MuiTablePagination-root-21"+ colSpan={4}+ scope={undefined}+ >+ <div+ className="MuiToolbar-root-27 MuiToolbar-gutters-28 MuiTablePagination-toolbar-26"+ >+ <div+ className="MuiTablePagination-spacer-25"+ />+ <div+ className="MuiTablePaginationActions-root-29"+ >+ <button+ className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"+ disabled={true}+ onBlur={[Function]}+ onClick={[MockFunction]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ tabIndex="-1"+ type="button"+ >+ <span+ className="MuiIconButton-label-35"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-39"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"+ />+ </svg>+ </span>+ </button>+ <button+ className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"+ disabled={true}+ onBlur={[Function]}+ onClick={[MockFunction]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ tabIndex="-1"+ type="button"+ >+ <span+ className="MuiIconButton-label-35"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-39"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"+ />+ </svg>+ </span>+ </button>+ </div>+ </div>+ </td>+ </tr>+ </tfoot>+ <tbody+ className="MuiTableBody-root-45"+ >+ <tr+ className="MuiTableRow-root-5"+ >+ <td+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-body-12"+ scope={undefined}+ >+ <span+ className="Component-skeleton-46"+ style={undefined}+ >+ + </span>+ </td>+ <td+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-body-12"+ scope={undefined}+ >+ <span+ className="Component-skeleton-46"+ style={undefined}+ >+ + </span>+ </td>+ </tr>+ </tbody>+</table>+`;++exports[`<PageList /> renders when data is fully loaded 1`] = `+<table+ className="MuiTable-root-3"+>+ <thead+ className="MuiTableHead-root-4"+ >+ <tr+ className="MuiTableRow-root-5 MuiTableRow-head-6"+ >+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11"+ scope="col"+ >+ Name+ </th>+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11"+ scope="col"+ >+ Url+ </th>+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11"+ scope="col"+ >+ Visibility+ </th>+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11 Component-textRight-2"+ scope="col"+ >+ Actions+ </th>+ </tr>+ </thead>+ <tfoot>+ <tr+ className="MuiTableRow-root-5 MuiTableRow-footer-7"+ >+ <td+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-footer-13 MuiTablePagination-root-21"+ colSpan={4}+ scope={undefined}+ >+ <div+ className="MuiToolbar-root-27 MuiToolbar-gutters-28 MuiTablePagination-toolbar-26"+ >+ <div+ className="MuiTablePagination-spacer-25"+ />+ <div+ className="MuiTablePaginationActions-root-29"+ >+ <button+ className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"+ disabled={true}+ onBlur={[Function]}+ onClick={[MockFunction]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ tabIndex="-1"+ type="button"+ >+ <span+ className="MuiIconButton-label-35"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-39"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"+ />+ </svg>+ </span>+ </button>+ <button+ className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"+ disabled={true}+ onBlur={[Function]}+ onClick={[MockFunction]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ tabIndex="-1"+ type="button"+ >+ <span+ className="MuiIconButton-label-35"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-39"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"+ />+ </svg>+ </span>+ </button>+ </div>+ </div>+ </td>+ </tr>+ </tfoot>+ <tbody+ className="MuiTableBody-root-45"+ >+ <tr+ className="MuiTableRow-root-5"+ >+ <td+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-body-12"+ scope={undefined}+ >+ <span+ className="Component-skeleton-46"+ style={undefined}+ >+ + </span>+ </td>+ <td+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-body-12"+ scope={undefined}+ >+ <span+ className="Component-skeleton-46"+ style={undefined}+ >+ + </span>+ </td>+ </tr>+ </tbody>+</table>+`;++exports[`<PageList /> renders while data is loading 1`] = `+<table+ className="MuiTable-root-3"+>+ <thead+ className="MuiTableHead-root-4"+ >+ <tr+ className="MuiTableRow-root-5 MuiTableRow-head-6"+ >+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11"+ scope="col"+ >+ Name+ </th>+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11"+ scope="col"+ >+ Url+ </th>+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11"+ scope="col"+ >+ Visibility+ </th>+ <th+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-head-11 Component-textRight-2"+ scope="col"+ >+ Actions+ </th>+ </tr>+ </thead>+ <tfoot>+ <tr+ className="MuiTableRow-root-5 MuiTableRow-footer-7"+ >+ <td+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-footer-13 MuiTablePagination-root-21"+ colSpan={4}+ scope={undefined}+ >+ <div+ className="MuiToolbar-root-27 MuiToolbar-gutters-28 MuiTablePagination-toolbar-26"+ >+ <div+ className="MuiTablePagination-spacer-25"+ />+ <div+ className="MuiTablePaginationActions-root-29"+ >+ <button+ className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"+ disabled={true}+ onBlur={[Function]}+ onClick={[MockFunction]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ tabIndex="-1"+ type="button"+ >+ <span+ className="MuiIconButton-label-35"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-39"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"+ />+ </svg>+ </span>+ </button>+ <button+ className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"+ disabled={true}+ onBlur={[Function]}+ onClick={[MockFunction]}+ onFocus={[Function]}+ onKeyDown={[Function]}+ onKeyUp={[Function]}+ onMouseDown={[Function]}+ onMouseLeave={[Function]}+ onMouseUp={[Function]}+ onTouchEnd={[Function]}+ onTouchMove={[Function]}+ onTouchStart={[Function]}+ tabIndex="-1"+ type="button"+ >+ <span+ className="MuiIconButton-label-35"+ >+ <svg+ aria-hidden="true"+ className="MuiSvgIcon-root-39"+ color={undefined}+ focusable="false"+ viewBox="0 0 24 24"+ >+ <path+ d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"+ />+ </svg>+ </span>+ </button>+ </div>+ </div>+ </td>+ </tr>+ </tfoot>+ <tbody+ className="MuiTableBody-root-45"+ >+ <tr+ className="MuiTableRow-root-5"+ >+ <td+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-body-12"+ scope={undefined}+ >+ <span+ className="Component-skeleton-46"+ style={undefined}+ >+ + </span>+ </td>+ <td+ aria-sort={null}+ className="MuiTableCell-root-10 MuiTableCell-body-12"+ scope={undefined}+ >+ <span+ className="Component-skeleton-46"+ style={undefined}+ >+ + </span>+ </td>+ </tr>+ </tbody>+</table>+`;diff --git a/saleor/static/dashboard-next/page/components/PageList/index.ts b/saleor/static/dashboard-next/page/components/PageList/index.tsnew file mode 100644index 0000000000..ceef274c33--- /dev/null+++ b/saleor/static/dashboard-next/page/components/PageList/index.ts@@ -0,0 +1,2 @@+export { default } from "./PageList";+export * from "./PageList";diff --git a/saleor/static/dashboard-next/page/views/PageList.tsx b/saleor/static/dashboard-next/page/views/PageList.tsxindex ec80405301..4a79726f46 100644--- a/saleor/static/dashboard-next/page/views/PageList.tsx+++ b/saleor/static/dashboard-next/page/views/PageList.tsx@@ -14,7 +14,7 @@ import Navigator from "../../components/Navigator";import PageHeader from "../../components/PageHeader";import i18n from "../../i18n";import PageFilters from "../components/PageFilters";-import PageListComponent from "../components/PageListComponent";+import PageListComponent from "../components/PageList";import { pageEditUrl, pageStorefrontUrl } from "../index";import { pageListQuery, TypedPageListQuery } from "../queries";