Skip to content

Commit

Permalink
fix(breadcrumbs): color attribute shows on DOM for Vue (#27068)
Browse files Browse the repository at this point in the history
Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
  • Loading branch information
sean-perkins and thetaPC committed Mar 30, 2023
1 parent 6d851f1 commit 141ced5
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ ion-breadcrumb,part,native
ion-breadcrumb,part,separator

ion-breadcrumbs,shadow
ion-breadcrumbs,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,false
ion-breadcrumbs,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
ion-breadcrumbs,prop,itemsAfterCollapse,number,1,false,false
ion-breadcrumbs,prop,itemsBeforeCollapse,number,1,false,false
ion-breadcrumbs,prop,maxItems,number | undefined,undefined,false,false
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/breadcrumbs/breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Breadcrumbs implements ComponentInterface {
* Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
* For more information on colors, see [theming](/docs/theming/basics).
*/
@Prop() color?: Color;
@Prop({ reflect: true }) color?: Color;

/**
* The maximum number of breadcrumbs to show before collapsing.
Expand Down
4 changes: 4 additions & 0 deletions packages/vue/test/base/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ const routes: Array<RouteRecordRaw> = [
path: '/components',
component: () => import('@/views/Components.vue'),
},
{
path: '/components/breadcrumbs',
component: () => import('@/views/Breadcrumbs.vue')
},
{
path: '/components/select',
component: () => import('@/views/Select.vue')
Expand Down
53 changes: 53 additions & 0 deletions packages/vue/test/base/src/views/Breadcrumbs.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<template>
<ion-page>
<ion-header>
<ion-toolbar>
<ion-title>Breadcrumbs</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<h1>Default</h1>
<ion-breadcrumbs id="default">
<ion-breadcrumb href="#"> Home </ion-breadcrumb>
<ion-breadcrumb href="#electronics"> Electronics </ion-breadcrumb>
<ion-breadcrumb href="#photography"> Photography </ion-breadcrumb>
<ion-breadcrumb href="#cameras"> Cameras </ion-breadcrumb>
<ion-breadcrumb href="#film"> Film </ion-breadcrumb>
<ion-breadcrumb> 35 mm </ion-breadcrumb>
</ion-breadcrumbs>
<hr />
<h1>Color: Danger</h1>
<ion-breadcrumbs id="color" color="danger">
<ion-breadcrumb href="#"> Home </ion-breadcrumb>
<ion-breadcrumb href="#electronics"> Electronics </ion-breadcrumb>
<ion-breadcrumb href="#photography"> Photography </ion-breadcrumb>
<ion-breadcrumb href="#cameras"> Cameras </ion-breadcrumb>
<ion-breadcrumb href="#film"> Film </ion-breadcrumb>
<ion-breadcrumb> 35 mm </ion-breadcrumb>
</ion-breadcrumbs>
</ion-content>
</ion-page>
</template>

<script lang="ts">
import {
IonPage,
IonHeader,
IonToolbar,
IonTitle,
IonContent,
IonBreadcrumbs,
} from "@ionic/vue";
import { defineComponent } from "vue";
export default defineComponent({
components: {
IonPage,
IonHeader,
IonToolbar,
IonTitle,
IonContent,
IonBreadcrumbs,
},
});
</script>
3 changes: 3 additions & 0 deletions packages/vue/test/base/src/views/Components.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<ion-page>
<ion-content>
<ion-list>
<ion-item button router-link="/components/breadcrumbs">
<ion-label>Breadcrumbs</ion-label>
</ion-item>
<ion-item button router-link="/components/select">
<ion-label>Select</ion-label>
</ion-item>
Expand Down
9 changes: 9 additions & 0 deletions packages/vue/test/base/tests/e2e/specs/breadcrumbs.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe("Components: Breadcrumbs", () => {
beforeEach(() => {
cy.visit("http://localhost:8080/components/breadcrumbs");
});

it("should have color attribute", () => {
cy.get('ion-breadcrumbs#color').should('have.prop', 'color');
});
});

0 comments on commit 141ced5

Please sign in to comment.