-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Component ProfileAboutCard: Component creation
- Loading branch information
1 parent
ebba4d3
commit ca03ea4
Showing
3 changed files
with
149 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { stubbedRender } from '@/testUtils'; | ||
import ProfileAboutCard from './ProfileAboutCard'; | ||
|
||
describe('<ProfileAboutCard />', () => { | ||
it('should render without crashing', () => { | ||
const { unmount } = stubbedRender(ProfileAboutCard); | ||
|
||
unmount(); | ||
}); | ||
|
||
it('renders correctly', () => { | ||
const { container } = stubbedRender(ProfileAboutCard); | ||
|
||
expect(container.firstChild).toMatchSnapshot(); | ||
}); | ||
}); |
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,63 @@ | ||
<template> | ||
<div class="profile-about-card"> | ||
<div class="border-b border-gray-300"> | ||
<h2 class="text-xl font-bold">About</h2> | ||
</div> | ||
|
||
<div> | ||
<p class="text-black">{{ bio }}</p> | ||
<div class="mt-5"> | ||
<CoreSocialButtons :socials="socials" /> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { defineComponent } from '@nuxtjs/composition-api'; | ||
export default defineComponent({ | ||
props: { | ||
bio: { | ||
default: () => | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget dapibus libero. Morbi ultricies varius accumsan.', | ||
type: String, | ||
}, | ||
socials: { | ||
default: () => [ | ||
{ | ||
icon: 'dscrd', | ||
name: 'Discord', | ||
url: 'https://discord.com/', | ||
}, | ||
{ | ||
icon: 'twch', | ||
name: 'Twitch', | ||
url: 'https://twitch.tv/', | ||
}, | ||
{ | ||
icon: 'twtr', | ||
name: 'Twitter', | ||
url: 'https://twitter.com/', | ||
}, | ||
{ | ||
icon: 'yt', | ||
name: 'Youtube', | ||
url: 'https://youtube.com/', | ||
}, | ||
], | ||
type: Array, | ||
}, | ||
}, | ||
}); | ||
</script> | ||
|
||
<style scoped> | ||
.profile-about-card { | ||
@apply hidden md:flex flex-col border rounded border-gray-300; | ||
} | ||
.profile-about-card > div { | ||
@apply p-5; | ||
} | ||
</style> |
70 changes: 70 additions & 0 deletions
70
components/ProfileAboutCard/__snapshots__/ProfileAboutCard.test.js.snap
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,70 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<ProfileAboutCard /> renders correctly 1`] = ` | ||
<div | ||
class="profile-about-card" | ||
> | ||
<div | ||
class="border-b border-gray-300" | ||
> | ||
<h2 | ||
class="text-xl font-bold" | ||
> | ||
About | ||
</h2> | ||
</div> | ||
<div> | ||
<p | ||
class="text-black" | ||
> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget dapibus libero. Morbi ultricies varius accumsan. | ||
</p> | ||
<div | ||
class="mt-5" | ||
> | ||
<div | ||
class="social-button--container" | ||
> | ||
<a | ||
alt="Discord" | ||
class="social-button" | ||
href="https://discord.com/" | ||
> | ||
dscrd | ||
</a> | ||
<a | ||
alt="Twitch" | ||
class="social-button" | ||
href="https://twitch.tv/" | ||
> | ||
twch | ||
</a> | ||
<a | ||
alt="Twitter" | ||
class="social-button" | ||
href="https://twitter.com/" | ||
> | ||
twtr | ||
</a> | ||
<a | ||
alt="Youtube" | ||
class="social-button" | ||
href="https://youtube.com/" | ||
> | ||
yt | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`; |