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

test: components/breadcrumb-item #541

Merged
merged 6 commits into from
Sep 28, 2021

Conversation

christoshrousis
Copy link
Contributor

@christoshrousis christoshrousis commented Sep 25, 2021

I made a change here that users should be able to control the "rel" attribute when it's supplied.

Test suite itself, non-eventful.

@vercel
Copy link

vercel bot commented Sep 25, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/shoelace/shoelace/3Sq5p5NGtk1JEYXze7iunm1XhMXv
✅ Preview: https://shoelace-git-fork-christoshrousis-test-breadcrumb-item-shoelace.vercel.app

Comment on lines 70 to 71
target="${this.target}"
rel=${ifDefined(this.target ? 'noreferrer noopener' : undefined)}
rel=${ifDefined(this.target ? rel : undefined)}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The "target" could potentially be wrapped in an ifDefined but not sure if that's over engineering. Currently it results in a target="" when not supplied, but that still passes AXE apparently.

handleSlotChange() {
this.hasPrefix = hasSlot(this, 'prefix');
this.hasSuffix = hasSlot(this, 'suffix');
}

render() {
const isLink = this.href ? true : false;
const rel = this.rel ? this.rel : 'noreferrer noopener';
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious if there's a reason you're setting the default here instead of on line 40. I typically set the default in the prop's definition so the CEM analyzer picks it up and it gets shown in the docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we wouldn't want it to be more succinct would we 🙄 /sarcasm 🤦🏼

@claviska
Copy link
Member

Thanks so much for this! Everything looks good here, just one thing about rel and this will be good to go!

@christoshrousis
Copy link
Contributor Author

christoshrousis commented Sep 28, 2021

Funnily enough having the test in place made it easy to make the change you picked up! 😅 Thanks for that, slight oversight on my end.

@claviska claviska merged commit bc3e9c4 into shoelace-style:next Sep 28, 2021
@christoshrousis christoshrousis deleted the test/breadcrumb-item branch October 24, 2021 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants