freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

issues with tests for Design a Business Card lab

Open majestic-owl448 opened this issue 7 months ago • 6 comments

after #59930 campers are allowed to use the a elements for email and phone number.

But now there is an other set of situations that fail:

people often add more containers than asked, main, section etc

I wonder if we should change the requested div.business-card to a semating element, like main or section

And also I wonder in what way could the tests be changed to allow this creativity freedom.

majestic-owl448 avatar May 15 '25 09:05 majestic-owl448

we can make an array of allowed elements like:

const elements = ['DIV','MAIN','SECTION','ARTICLE']; const card = document.querySelector('.business-card'); assert.include(allowed, card.tagName) to check if the element is one of the allowed ones

Sky-walkerX avatar May 16 '25 04:05 Sky-walkerX

that would not fix the issue, as campers add extra containers inside .business-card

majestic-owl448 avatar May 16 '25 07:05 majestic-owl448

Ohh, then we can remove that strict check for anchor tag to be direct child of element having class named business-card

Sky-walkerX avatar May 16 '25 09:05 Sky-walkerX

We still need a way to individuate which anchor element to test. People like to add anchor elements with mailto and href for the p elements, which is what brough the change in that PR

majestic-owl448 avatar May 16 '25 18:05 majestic-owl448

Can we add ids to these elements?

a2937 avatar May 17 '25 20:05 a2937

if we add that to the user stories, it's a way for sure

majestic-owl448 avatar May 21 '25 18:05 majestic-owl448

someone on the forum ran into a problem with the test and I'm just linking it here for reference: https://forum.freecodecamp.org/t/design-a-business-card-design-a-business-card/752684

hbar1st avatar Jun 27 '25 14:06 hbar1st

it is the same issue described here, it happens pretty often on the forum

majestic-owl448 avatar Jun 27 '25 14:06 majestic-owl448

it is the same issue described here, it happens pretty often on the forum

Hey, does the PR I linked cover the requirements?

Sky-walkerX avatar Jun 28 '25 07:06 Sky-walkerX

@Sky-walkerX it will need to be reviewed to know that

majestic-owl448 avatar Jun 28 '25 07:06 majestic-owl448

i love to contribute in open source

Shivfun99 avatar Jul 04 '25 08:07 Shivfun99

i love to contribute in open source

We typically do not assign issues. Instead, we accept the first pull request that comprehensively solves the issue.

Issues labeled with help wanted or first timers only are open for contributions.

Please make sure you read our guidelines for contributing. We prioritize contributors following the instructions in our guide. Join us in our chat room or the forum if you need help contributing - our community will be happy to assist you.

a2937 avatar Jul 04 '25 14:07 a2937