Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions storybook test #5049

Merged
merged 6 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/5049.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Storybook Actions component test-@Tishasoumya-02
138 changes: 138 additions & 0 deletions src/components/manage/Actions/Actions.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import { injectIntl } from 'react-intl';
import React from 'react';
import ActionsComponent from './Actions';
import { RealStoreWrapper as Wrapper } from '@plone/volto/storybook';

const IntlActionsComponent = injectIntl(ActionsComponent);

function StoryComponent(args) {
return (
<Wrapper
customStore={{
actions: {
actions: {
document_actions: [],
object: [
{
icon: '',
id: 'view',
title: 'View',
},
{
icon: '',
id: 'edit',
title: 'Edit',
},
{
icon: '',
id: 'folderContents',
title: 'Contents',
},
{
icon: '',
id: 'history',
title: 'History',
},
{
icon: '',
id: 'local_roles',
title: 'Sharing',
},
],
object_buttons: [
{
icon: '',
id: 'cut',
title: 'Cut',
},
{
icon: '',
id: 'copy',
title: 'Copy',
},
{
icon: '',
id: 'delete',
title: 'Delete',
},
{
icon: '',
id: 'rename',
title: 'Rename',
},
{
icon: '',
id: 'ical_import_enable',
title: 'Enable icalendar import',
},
],
portal_tabs: [],
site_actions: [
{
icon: '',
id: 'sitemap',
title: 'Site Map',
},
{
icon: '',
id: 'accessibility',
title: 'Accessibility',
},
{
icon: '',
id: 'contact',
title: 'Contact',
},
],
user: [
{
icon: '',
id: 'preferences',
title: 'Preferences',
},
{
icon: '',
id: 'dashboard',
title: 'Dashboard',
},
{
icon: '',
id: 'plone_setup',
title: 'Site Setup',
},
{
icon: '',
id: 'logout',
title: 'Log out',
},
],
},
},
clipboard: {},
content: { data: { id: 'blog', title: 'Blog' } },
intl: {
locale: 'en',
messages: {},
},
}}
>
<div id="toolbar" style={{ display: 'none' }} />
<IntlActionsComponent {...args} pathname="/test" />
</Wrapper>
);
}

export const Actions = StoryComponent.bind({});

export default {
title: 'Public components/Actions',
component: Actions,
decorators: [
(Story) => (
<div className="ui segment form attached" style={{ width: '400px' }}>
<Story />
</div>
),
],
argTypes: {},
};