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: Make email in contact block "mailto" #523

Merged
merged 4 commits into from
Jul 20, 2023
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
Expand Up @@ -10,12 +10,17 @@
{{ shownContact.organisation }}
</div>
</div>
<p class="text-gray-700 text-sm">{{ shownContact.email }}</p>
<a
[href]="'mailto:' + shownContact.email"
class="text-gray-700 text-sm"
target="_blank"
>{{ shownContact.email }}</a
>
<div *ngIf="shownContact.website" class="mb-2">
<a
[href]="shownContact.website"
target="_blank"
class="text-primary text-sm cursor-pointer hover:underline transition-all"
class="contact-website text-primary text-sm cursor-pointer hover:underline transition-all"
>{{ shownContact.website }}
<mat-icon class="!w-[12px] !h-[12px] !text-[12px] opacity-75"
>open_in_new</mat-icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ describe('MetadataContactComponent', () => {
})
})
describe('content', () => {
let ps
let email
beforeEach(() => {
ps = fixture.debugElement.queryAll(By.css('p'))
email = fixture.debugElement.query(By.css('a'))
})
it('displays the contact name', () => {
const el = fixture.debugElement.query(
Expand All @@ -69,10 +69,10 @@ describe('MetadataContactComponent', () => {
expect(el.innerHTML).toBe(' Worldcorp ')
})
it('displays the contact email', () => {
expect(ps[1].nativeElement.innerHTML).toBe('[email protected]')
expect(email.attributes.href).toBe('mailto:[email protected]')
})
it('displays a link to the contact website', () => {
const a = fixture.debugElement.query(By.css('a'))
const a = fixture.debugElement.query(By.css('.contact-website'))
expect(a.attributes.href).toBe('https://john.world.co')
expect(a.attributes.target).toBe('_blank')
})
Expand Down