Skip to content
Open
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
2 changes: 2 additions & 0 deletions core/src/components/breadcrumb/breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export class Breadcrumb implements ComponentInterface {
el,
inheritedAttributes,
last,
rel,
routerAnimation,
routerDirection,
separator,
Expand All @@ -203,6 +204,7 @@ export class Breadcrumb implements ComponentInterface {
: {
download,
href,
rel,
target,
};

Expand Down
16 changes: 16 additions & 0 deletions core/src/components/breadcrumb/test/breadcrumb.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { newSpecPage } from '@stencil/core/testing';

import { Breadcrumb } from '../breadcrumb';

describe('breadcrumb: rel', () => {
it('should set the rel attribute on the link', async () => {
const page = await newSpecPage({
components: [Breadcrumb],
html: `<ion-breadcrumb href="https://ionic.io" rel="noopener noreferrer">Ionic</ion-breadcrumb>`,
});

const link = page.body.querySelector('ion-breadcrumb')!.shadowRoot!.querySelector('a')!;

expect(link.getAttribute('rel')).toBe('noopener noreferrer');
});
});
1 change: 1 addition & 0 deletions core/src/components/item-option/item-option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export class ItemOption implements ComponentInterface, AnchorInterface, ButtonIn
: {
download: this.download,
href: this.href,
rel: this.rel,
target: this.target,
};

Expand Down
13 changes: 13 additions & 0 deletions core/src/components/item-option/test/item-option.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@ describe('item option: tabindex', () => {
expect(nativeEl.getAttribute('tabindex')).toBe('0');
});
});

describe('item option: rel', () => {
it('should set the rel attribute on the link', async () => {
const page = await newSpecPage({
components: [ItemOption],
html: `<ion-item-option href="https://ionic.io" rel="noopener noreferrer">Ionic</ion-item-option>`,
});

const link = page.body.querySelector('ion-item-option')!.shadowRoot!.querySelector('a')!;

expect(link.getAttribute('rel')).toBe('noopener noreferrer');
});
});
Loading