/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */
import { render } from '@testing-library/react';
import { ThemeProvider } from 'styled-components';

/**
 * Internal dependencies
 */
import theme from '../../../theme';
import StylePreset from '../stylePreset';

function arrange(children = null) {
  return render(<ThemeProvider theme={theme}>{children}</ThemeProvider>);
}

describe('Panels/StylePreset', () => {
  it('should render <StylePreset /> panel', () => {
    const { getByText } = arrange(<StylePreset />);

    const element = getByText('Style presets');

    expect(element).toBeDefined();
  });
  // TODO: More tests should be defined as soon as we start https://github.com/google/web-stories-wp/issues/279
});

@@ -810,16 +810,21 @@
 lePreset
+Panel
  from '.
@@ -843,61 +843,628 @@
 t';%0A
-%0Afunction arrange(children = null) %7B%0A  return
+import StoryContext from '../../../app/story/context';%0A%0Afunction setupPanel(extraStateProps) %7B%0A  const updateStory = jest.fn();%0A  const updateElementsById = jest.fn();%0A%0A  const textElement = %7B%0A    id: '1',%0A    type: 'text',%0A    x: 111,%0A    y: 112,%0A    width: 211,%0A    height: 221,%0A    rotationAngle: 1,%0A  %7D;%0A  const storyContextValue = %7B%0A    state: %7B%0A      selectedElementIds: %5B'1'%5D,%0A      selectedElements: %5BtextElement%5D,%0A      story: %7B%0A        stylePresets: %7B colors: %5B%5D, textColors: %5B%5D %7D,%0A      %7D,%0A      ...extraStateProps,%0A    %7D,%0A    actions: %7B updateStory, updateElementsById %7D,%0A  %7D;%0A  const %7B getByText %7D =
  render(
 %3CThe
@@ -1459,16 +1459,21 @@
  render(
+%0A    
 %3CThemePr
@@ -1497,35 +1497,221 @@
 me%7D%3E
-%7Bchildren%7D%3C/ThemeProvider%3E)
+%0A      %3CStoryContext.Provider value=%7BstoryContextValue%7D%3E%0A        %3CStylePresetPanel /%3E%0A      %3C/StoryContext.Provider%3E%0A    %3C/ThemeProvider%3E%0A  );%0A  return %7B%0A    getByText,%0A    updateStory,%0A    updateElementsById,%0A  %7D
 ;%0A%7D%0A
@@ -1782,16 +1782,21 @@
 lePreset
+Panel
  /%3E pane
@@ -1837,35 +1837,22 @@
 %7D = 
-arrange(%3CStylePreset /%3E
+setupPanel(
 );%0A
-%0A
     
@@ -1895,17 +1895,16 @@
 sets');%0A
-%0A
     expe
@@ -1940,120 +1940,8 @@
 %7D);%0A
-  // TODO: More tests should be defined as soon as we start https://github.com/google/web-stories-wp/issues/279%0A
 %7D);%0A

Add test for rendering style presets panel.