Commit 370fac6a authored by Tom Quirk's avatar Tom Quirk

Group design item_spec tests by presence of notes

In an effort to improve readability of this test
parent 6732ec11
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Design management list item component hides comment count 1`] = `
exports[`Design management list item component with no notes hides comment count 1`] = `
<router-link-stub
class="card cursor-pointer text-plain js-design-list-item design-list-item"
to="[object Object]"
......@@ -49,7 +49,7 @@ exports[`Design management list item component hides comment count 1`] = `
</router-link-stub>
`;
exports[`Design management list item component renders item with correct status icon for creation event 1`] = `
exports[`Design management list item component with no notes renders item with correct status icon for creation event 1`] = `
<router-link-stub
class="card cursor-pointer text-plain js-design-list-item design-list-item"
to="[object Object]"
......@@ -111,7 +111,7 @@ exports[`Design management list item component renders item with correct status
</router-link-stub>
`;
exports[`Design management list item component renders item with correct status icon for deletion event 1`] = `
exports[`Design management list item component with no notes renders item with correct status icon for deletion event 1`] = `
<router-link-stub
class="card cursor-pointer text-plain js-design-list-item design-list-item"
to="[object Object]"
......@@ -173,7 +173,7 @@ exports[`Design management list item component renders item with correct status
</router-link-stub>
`;
exports[`Design management list item component renders item with correct status icon for modification event 1`] = `
exports[`Design management list item component with no notes renders item with correct status icon for modification event 1`] = `
<router-link-stub
class="card cursor-pointer text-plain js-design-list-item design-list-item"
to="[object Object]"
......@@ -235,7 +235,7 @@ exports[`Design management list item component renders item with correct status
</router-link-stub>
`;
exports[`Design management list item component renders item with multiple comments 1`] = `
exports[`Design management list item component with notes renders item with multiple comments 1`] = `
<router-link-stub
class="card cursor-pointer text-plain js-design-list-item design-list-item"
to="[object Object]"
......@@ -301,7 +301,7 @@ exports[`Design management list item component renders item with multiple commen
</router-link-stub>
`;
exports[`Design management list item component renders item with no status icon for none event 1`] = `
exports[`Design management list item component with no notes renders item with no status icon for none event 1`] = `
<router-link-stub
class="card cursor-pointer text-plain js-design-list-item design-list-item"
to="[object Object]"
......@@ -350,7 +350,7 @@ exports[`Design management list item component renders item with no status icon
</router-link-stub>
`;
exports[`Design management list item component renders item with single comment 1`] = `
exports[`Design management list item component with notes renders item with single comment 1`] = `
<router-link-stub
class="card cursor-pointer text-plain js-design-list-item design-list-item"
to="[object Object]"
......@@ -416,7 +416,7 @@ exports[`Design management list item component renders item with single comment
</router-link-stub>
`;
exports[`Design management list item component renders loading spinner when no image prop present 1`] = `
exports[`Design management list item component with no notes renders loading spinner when no image prop present 1`] = `
<router-link-stub
class="card cursor-pointer text-plain js-design-list-item design-list-item"
to="[object Object]"
......
......@@ -41,51 +41,55 @@ describe('Design management list item component', () => {
wrapper.destroy();
});
it('renders item with single comment', () => {
createComponent();
describe('with notes', () => {
it('renders item with single comment', () => {
createComponent();
expect(wrapper.element).toMatchSnapshot();
});
expect(wrapper.element).toMatchSnapshot();
});
it('renders item with multiple comments', () => {
createComponent({ notesCount: 2 });
it('renders item with multiple comments', () => {
createComponent({ notesCount: 2 });
expect(wrapper.element).toMatchSnapshot();
expect(wrapper.element).toMatchSnapshot();
});
});
it('hides comment count', () => {
createComponent({ notesCount: 0 });
describe('with no notes', () => {
it('hides comment count', () => {
createComponent({ notesCount: 0 });
expect(wrapper.element).toMatchSnapshot();
});
expect(wrapper.element).toMatchSnapshot();
});
it('renders item with correct status icon for modification event', () => {
createComponent({ notesCount: 0, event: DESIGN_VERSION_EVENT.MODIFICATION });
it('renders item with correct status icon for modification event', () => {
createComponent({ notesCount: 0, event: DESIGN_VERSION_EVENT.MODIFICATION });
expect(wrapper.element).toMatchSnapshot();
});
expect(wrapper.element).toMatchSnapshot();
});
it('renders item with correct status icon for deletion event', () => {
createComponent({ notesCount: 0, event: DESIGN_VERSION_EVENT.DELETION });
it('renders item with correct status icon for deletion event', () => {
createComponent({ notesCount: 0, event: DESIGN_VERSION_EVENT.DELETION });
expect(wrapper.element).toMatchSnapshot();
});
expect(wrapper.element).toMatchSnapshot();
});
it('renders item with correct status icon for creation event', () => {
createComponent({ notesCount: 0, event: DESIGN_VERSION_EVENT.CREATION });
it('renders item with correct status icon for creation event', () => {
createComponent({ notesCount: 0, event: DESIGN_VERSION_EVENT.CREATION });
expect(wrapper.element).toMatchSnapshot();
});
expect(wrapper.element).toMatchSnapshot();
});
it('renders item with no status icon for none event', () => {
createComponent({ notesCount: 0 });
it('renders item with no status icon for none event', () => {
createComponent({ notesCount: 0 });
expect(wrapper.element).toMatchSnapshot();
});
expect(wrapper.element).toMatchSnapshot();
});
it('renders loading spinner when no image prop present', () => {
createComponent({ notesCount: 0, isLoading: true });
it('renders loading spinner when no image prop present', () => {
createComponent({ notesCount: 0, isLoading: true });
expect(wrapper.element).toMatchSnapshot();
expect(wrapper.element).toMatchSnapshot();
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment