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

feat: add basic comments container for future comment work #335

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { render } from '@testing-library/vue';
import Container from '../../../../vue/KvCommentsContainer.vue';

const renderContainer = (props = {}) => {
return render(Container, { props });
};

describe('KvCommentsContainer', () => {
it('should render without activity ID', async () => {
const component = renderContainer();
component.getByText('Activity ID missing');
});

it('should render with activity ID', async () => {
const component = renderContainer({ activityId: 'asd' });
component.getByText('Comment functionality coming soon!');
});
});
28 changes: 28 additions & 0 deletions @kiva/kv-components/vue/KvCommentsContainer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<div>
<h3>Comment Container Placeholder</h3>
<p v-if="activityId">
Comment functionality coming soon!
</p>
<p
v-else
class="tw-text-desert-rose"
>
Activity ID missing
</p>
</div>
</template>

<script>
export default {
props: {
/**
* The activity ID for the comments
*/
activityId: {
type: String,
default: '',
},
},
};
</script>
23 changes: 23 additions & 0 deletions @kiva/kv-components/vue/stories/KvCommentsContainer.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import KvCommentsContainer from '../KvCommentsContainer.vue';

export default {
title: 'KvCommentsContainer',
component: KvCommentsContainer,
};

const story = (args) => {
const template = (templateArgs, { argTypes }) => ({
props: Object.keys(argTypes),
components: { KvCommentsContainer },
setup() { return { args: templateArgs }; },
template: `
<KvCommentsContainer v-bind="args" />
`,
});
template.args = args;
return template;
};

export const Default = story({});

export const Activity = story({ activityId: 'asd' });
Loading