-
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.
update all tests to use compacted format
- Loading branch information
Showing
4 changed files
with
100 additions
and
212 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,37 @@ | ||
import { storiesOf, specs, describe, it } from '!/facade' | ||
import { render, cleanup } from '@testing-library/svelte' | ||
import expect from 'expect' | ||
import { componentStories, it, render, expect } from '!/testing-framework' | ||
|
||
import Kanban from './Kanban.svelte' | ||
import markdownNotes from './Kanban.stories.md' | ||
|
||
storiesOf('Kanban|Whole board', module) | ||
componentStories('Kanban|Whole board', Kanban, module, markdownNotes) | ||
|
||
.add('empty state', | ||
() => { | ||
specs(() => describe('empty state', () => { | ||
it('should render', async () => { | ||
expect(render(Kanban)).toBeTruthy() | ||
cleanup() | ||
}) | ||
})) | ||
.add('empty state', {}, (props) => { | ||
it('should render', async () => { | ||
expect(render(Kanban, { props })).toBeTruthy() | ||
}) | ||
}) | ||
|
||
return { | ||
Component: Kanban, | ||
props: { | ||
.add('with tasks', { | ||
bins: [{ | ||
title: 'first batch of tasks', | ||
note: 'doing stuff', | ||
due: new Date(), | ||
cards: [{ | ||
note: 'a task that needs doing', | ||
due: new Date(), | ||
members: [ | ||
{ image: 'https://randomuser.me/api/portraits/women/28.jpg' }, | ||
{ image: 'https://randomuser.me/api/portraits/women/23.jpg' }, | ||
], | ||
}], | ||
outputs: [{ | ||
resourceClassifiedAs: { | ||
name: 'an output resource', | ||
}, | ||
} | ||
}, | ||
{ notes: { markdown: markdownNotes } }, | ||
) | ||
|
||
.add( | ||
'with tasks', | ||
() => { | ||
const props = { | ||
bins: [{ | ||
title: 'first batch of tasks', | ||
note: 'doing stuff', | ||
due: new Date(), | ||
cards: [{ | ||
note: 'a task that needs doing', | ||
due: new Date(), | ||
members: [ | ||
{ image: 'https://randomuser.me/api/portraits/women/28.jpg' }, | ||
{ image: 'https://randomuser.me/api/portraits/women/23.jpg' }, | ||
], | ||
}], | ||
outputs: [{ | ||
resourceClassifiedAs: { | ||
name: 'an output resource', | ||
}, | ||
}], | ||
}], | ||
} | ||
|
||
specs(() => describe('with tasks', () => { | ||
it('should render', async () => { | ||
expect(render(Kanban, { props })).toBeTruthy() | ||
cleanup() | ||
}) | ||
})) | ||
|
||
return { | ||
Component: Kanban, | ||
props, | ||
} | ||
}, | ||
{ notes: { markdown: markdownNotes } }, | ||
) | ||
}], | ||
}], | ||
}, (props) => { | ||
it('should render', async () => { | ||
expect(render(Kanban, { props })).toBeTruthy() | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,60 +1,30 @@ | ||
import { storiesOf, specs, describe, it } from '!/facade' | ||
import { render, cleanup } from '@testing-library/svelte' | ||
import expect from 'expect' | ||
import { componentStories, it, render, expect } from '!/testing-framework' | ||
|
||
import Bin from './Bin.svelte' | ||
import markdownNotes from './Bin.stories.md' | ||
|
||
storiesOf('Kanban|Task batch', module) | ||
|
||
.add( | ||
'empty state', | ||
() => { | ||
const props = { | ||
title: 'an empty task bin', | ||
} | ||
|
||
specs(() => describe('empty state', () => { | ||
it('should render', async () => { | ||
expect(render(Bin, { props })).toBeTruthy() | ||
cleanup() | ||
}) | ||
})) | ||
|
||
return { | ||
Component: Bin, | ||
props, | ||
} | ||
}, | ||
{ notes: { markdown: markdownNotes } }, | ||
) | ||
|
||
.add( | ||
'with cards', | ||
() => { | ||
const props = { | ||
title: 'bin with cards', | ||
cards: [ | ||
{ | ||
members: [{ image: 'https://randomuser.me/api/portraits/women/28.jpg' }], | ||
due: new Date(), | ||
note: 'need to do a thing', | ||
title: 'first task', | ||
}, | ||
], | ||
} | ||
|
||
specs(() => describe('with cards', () => { | ||
it('should render', async () => { | ||
expect(render(Bin, { props })).toBeTruthy() | ||
cleanup() | ||
}) | ||
})) | ||
|
||
return { | ||
Component: Bin, | ||
props, | ||
} | ||
}, | ||
{ notes: { markdown: markdownNotes } }, | ||
) | ||
componentStories('Kanban|Task batch', Bin, module, markdownNotes) | ||
|
||
.add('empty state', { | ||
title: 'an empty task bin', | ||
}, (props) => { | ||
it('should render', async () => { | ||
expect(render(Bin, { props })).toBeTruthy() | ||
}) | ||
}) | ||
|
||
.add('with cards', { | ||
title: 'bin with cards', | ||
cards: [ | ||
{ | ||
members: [{ image: 'https://randomuser.me/api/portraits/women/28.jpg' }], | ||
due: new Date(), | ||
note: 'need to do a thing', | ||
title: 'first task', | ||
}, | ||
], | ||
}, (props) => { | ||
it('should render', async () => { | ||
expect(render(Bin, { props })).toBeTruthy() | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,52 +1,25 @@ | ||
import { storiesOf, specs, describe, it } from '!/facade' | ||
import { render, cleanup } from '@testing-library/svelte' | ||
import expect from 'expect' | ||
import { componentStories, it, render, expect } from '!/testing-framework' | ||
|
||
import Card from './Card.svelte' | ||
import markdownNotes from './Card.stories.md' | ||
|
||
storiesOf('Kanban|Task card', module) | ||
componentStories('Kanban|Task card', Card, module, markdownNotes) | ||
|
||
.add( | ||
'empty state', | ||
() => { | ||
specs(() => describe('empty state', () => { | ||
it('should render', async () => { | ||
expect(render(Card)).toBeTruthy() | ||
cleanup() | ||
}) | ||
})) | ||
.add('empty state', {}, (props) => { | ||
it('should render', async () => { | ||
expect(render(Card, { props })).toBeTruthy() | ||
}) | ||
}) | ||
|
||
return { | ||
Component: Card, | ||
} | ||
}, | ||
{ notes: { markdown: markdownNotes } }, | ||
) | ||
|
||
.add( | ||
'with linked task', | ||
() => { | ||
const props = { | ||
note: 'a task that needs doing', | ||
due: new Date(), | ||
members: [ | ||
{ image: 'https://randomuser.me/api/portraits/women/28.jpg' }, | ||
{ image: 'https://randomuser.me/api/portraits/women/23.jpg' }, | ||
], | ||
} | ||
|
||
specs(() => describe('with linked task', () => { | ||
it('should render', async () => { | ||
expect(render(Card, { props })).toBeTruthy() | ||
cleanup() | ||
}) | ||
})) | ||
|
||
return { | ||
Component: Card, | ||
props, | ||
} | ||
}, | ||
{ notes: { markdown: markdownNotes } }, | ||
) | ||
.add('with linked task', { | ||
note: 'a task that needs doing', | ||
due: new Date(), | ||
members: [ | ||
{ image: 'https://randomuser.me/api/portraits/women/28.jpg' }, | ||
{ image: 'https://randomuser.me/api/portraits/women/23.jpg' }, | ||
], | ||
}, (props) => { | ||
it('should render', async () => { | ||
expect(render(Card, { props })).toBeTruthy() | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,58 +1,31 @@ | ||
import { storiesOf, specs, describe, it } from '!/facade' | ||
import { render, cleanup } from '@testing-library/svelte' | ||
import expect from 'expect' | ||
import { componentStories, it, render, expect } from '!/testing-framework' | ||
|
||
import Output from './Output.svelte' | ||
import markdownNotes from './Output.stories.md' | ||
|
||
storiesOf('Kanban|Batch output', module) | ||
componentStories('Kanban|Batch output', Output, module, markdownNotes) | ||
|
||
.add( | ||
'empty state', | ||
() => { | ||
specs(() => describe('empty state', () => { | ||
it('should render', async () => { | ||
expect(render(Output)).toBeTruthy() | ||
cleanup() | ||
}) | ||
})) | ||
.add('empty state', {}, (props) => { | ||
it('should render', async () => { | ||
expect(render(Output, { props })).toBeTruthy() | ||
}) | ||
}) | ||
|
||
return { | ||
Component: Output, | ||
} | ||
}, | ||
{ notes: { markdown: markdownNotes } }, | ||
) | ||
|
||
.add( | ||
'with output resources', | ||
() => { | ||
const props = { | ||
outputs: [ | ||
{ | ||
resourceClassifiedAs: { | ||
name: 'an output resource', | ||
}, | ||
}, | ||
{ | ||
resourceClassifiedAs: { | ||
name: 'another output resource', | ||
}, | ||
}, | ||
], | ||
} | ||
|
||
specs(() => describe('with output resources', () => { | ||
it('should render', async () => { | ||
expect(render(Output, { props })).toBeTruthy() | ||
cleanup() | ||
}) | ||
})) | ||
|
||
return { | ||
Component: Output, | ||
props, | ||
} | ||
}, | ||
{ notes: { markdown: markdownNotes } }, | ||
) | ||
.add('with output resources', { | ||
outputs: [ | ||
{ | ||
resourceClassifiedAs: { | ||
name: 'an output resource', | ||
}, | ||
}, | ||
{ | ||
resourceClassifiedAs: { | ||
name: 'another output resource', | ||
}, | ||
}, | ||
], | ||
}, (props) => { | ||
it('should render', async () => { | ||
expect(render(Output, { props })).toBeTruthy() | ||
}) | ||
}) |