Skip to content

Commit

Permalink
change dataCy to dataCypress
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerrie Wu committed Sep 18, 2024
1 parent ec4aa50 commit ec83984
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions examples/bpk-component-navigation-tab-group/examples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ const tabs: BpkNavigationTabGroupProps['tabs'] = [
];

const tabsWithIcon: BpkNavigationTabGroupProps['tabs'] = [
{ id: 'air', text: 'Flights', href: '/', icon: flightIcons, dataCy:'flight-feature', dataAnalyticsName:'flights' },
{ id: 'hotel', text: 'Hotels', href: '/hotel', icon: hotelIcons, dataCy:'hotel-feature', dataAnalyticsName:'hotels' },
{ id: 'car', text: 'Car hire', href: '/carhire', icon: carIcons, dataCy:'carhire-feature', dataAnalyticsName:'car hire' },
{ id: 'explore', text: 'Explore', href: '/Explore', icon: exploreIcons, dataCy:'explore-feature', dataAnalyticsName:'explore' },
{ id: 'air', text: 'Flights', href: '/', icon: flightIcons, dataCypress:'flight-feature', dataAnalyticsName:'flights' },
{ id: 'hotel', text: 'Hotels', href: '/hotel', icon: hotelIcons, dataCypress:'hotel-feature', dataAnalyticsName:'hotels' },
{ id: 'car', text: 'Car hire', href: '/carhire', icon: carIcons, dataCypress:'carhire-feature', dataAnalyticsName:'car hire' },
{ id: 'explore', text: 'Explore', href: '/Explore', icon: exploreIcons, dataCypress:'explore-feature', dataAnalyticsName:'explore' },
];

const tabsNoHref: BpkNavigationTabGroupProps['tabs'] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const tabs: Props['tabs'] = [
];

const tabsWithAnalytics: Props['tabs'] = [
{ id: 'air', text: 'Flights', href: '/', dataCy:'flight-feature', dataAnalyticsName:'flights' },
{ id: 'hotel', text: 'Hotels', href: '/hotel', dataCy:'hotel-feature', dataAnalyticsName:'hotels' },
{ id: 'car', text: 'Car hire', href: '/carhire', dataCy:'carhire-feature', dataAnalyticsName:'car hire' },
{ id: 'air', text: 'Flights', href: '/', dataCypress:'flight-feature', dataAnalyticsName:'flights' },
{ id: 'hotel', text: 'Hotels', href: '/hotel', dataCypress:'hotel-feature', dataAnalyticsName:'hotels' },
{ id: 'car', text: 'Car hire', href: '/carhire', dataCypress:'carhire-feature', dataAnalyticsName:'car hire' },
];

describe('BpkNavigationTabGroup', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type TabItem = {
text: string;
icon?: FunctionComponent<any> | null;
href?: string;
dataCy?: string;
dataCypress?: string;
dataAnalyticsName?: string;
};
export type Props = {
Expand Down Expand Up @@ -69,7 +69,7 @@ const TabWrap = ({ children, onClick, selected, tab, type }: TabWrapProps) => {
);

const tabProps = {
...(tab.dataCy && { 'data-cy': tab.dataCy }),
...(tab.dataCypress && { 'data-cy': tab.dataCypress }),
...(tab.dataAnalyticsName && { 'data-analytics-name': tab.dataAnalyticsName }),
id: tab.id,
className: tabStyling,
Expand Down

0 comments on commit ec83984

Please sign in to comment.