forked from chromaui/ui-testing-guide-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tutorial Commit chromaui#1 with Chromatic UI Change.
- Loading branch information
1 parent
f9a12b8
commit a01a0cc
Showing
4 changed files
with
388 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
|
||
import { Task } from './Task'; | ||
|
||
export default { | ||
component: Task, | ||
title: 'Task', | ||
argTypes: { | ||
onArchiveTask: { action: 'onArchiveTask' }, | ||
onTogglePinTask: { action: 'onTogglePinTask' }, | ||
onEditTask: { action: 'onEditTask' }, | ||
}, | ||
}; | ||
|
||
const Template = (args) => <Task {...args} />; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
task: { | ||
id: '1', | ||
title: 'Buy milk', | ||
state: 'TASK_INBOX', | ||
}, | ||
}; | ||
|
||
export const Pinned = Template.bind({}); | ||
Pinned.args = { | ||
task: { | ||
id: '2', | ||
title: 'QA dropdown', | ||
state: 'TASK_PINNED', | ||
}, | ||
}; | ||
|
||
export const Archived = Template.bind({}); | ||
Archived.args = { | ||
task: { | ||
id: '3', | ||
title: 'Write schema for account menu', | ||
state: 'TASK_ARCHIVED', | ||
}, | ||
}; | ||
|
||
const longTitleString = `This task's name is absurdly large. In fact, I think if I keep going I might end up with content overflow. What will happen? The star that represents a pinned task could have text overlapping. The text could cut-off abruptly when it reaches the star. I hope not!`; | ||
|
||
export const LongTitle = Template.bind({}); | ||
LongTitle.args = { | ||
task: { | ||
id: '4', | ||
title: longTitleString, | ||
state: 'TASK_INBOX', | ||
}, | ||
}; |
Oops, something went wrong.