Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Fix non english characters mz tab item #273

Merged
merged 6 commits into from
Jan 29, 2018

Conversation

scote
Copy link
Contributor

@scote scote commented Jan 23, 2018

Fixed #270

@Input() target: string;

tabs: HTMLElement;
liElement: HTMLElement;

get link(): string {
return this.label.replace(/\s+/g, '-').toLowerCase();
return this.tabItemId ? this.tabItemId : this.label.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No test to validate the regex with non english characters?

fixture.detectChanges();

expect(tabItems()[0].querySelector('a').getAttribute('href')).toBe('#label');
// expect(tabContent()[0].getAttribute('id')).toBe('label');
Copy link
Contributor

@jfcere jfcere Jan 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uncomment

</mz-tab>
`).then((fixture) => {

nativeElement = fixture.nativeElement;
fixture.detectChanges();

expect(tabItems()[0].querySelector('a').getAttribute('href')).toBe('#tabItemId');
expect(tabContent()[0].getAttribute('id')).toBe('tabItemId');
// expect(tabContent()[0].getAttribute('id')).toBe('tabItemId');
Copy link
Contributor

@jfcere jfcere Jan 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uncomment

@jfcere jfcere merged commit d6de430 into master Jan 29, 2018
@jfcere jfcere deleted the fix-non-english-characters-mz-tab-item branch January 29, 2018 16:04
@jfcere jfcere added this to the 1.8.0 milestone Jan 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants