Coder Social home page Coder Social logo

react-hooks-props-basics-lab's Issues

Content Clarity

Canvas Link

https://learning.flatironschool.com/courses/4542/assignments/150030?module_item_id=318021

Concern

Running through this lab, I spent a large amount of time trying to figure out why my test were failing despite the output appearing to be correct.

After digging through the tests I figured out that toBeInTheDocument() seems to only return the text content of the HTML tags and not the values of the various attributes. Upon closer inspection of the image on the lesson I do indeed see that it has the 'Links' URLs written out rather than the words 'GIthub' or 'LinkedIn', but I feel failing the tests on this is not really fair as the requirement only stated the links needed to be present.

If it's agreed that this path is a good one to go down, I'm happy to make the PR myself ๐Ÿ˜„

Additional Context

No response

Suggested Changes

I think a useful tweak would be to change the relevant tests to instead test for the href parameter. I'm definitely no React expert (yet!) but I tweaked the tests to produce what seemed to be what I was after like so:

test("passes 'github' to <Links> as a prop, via <About>", () => {
  const {container} = render(<App />);
  const a = container.querySelector(`a[href="${user.links.github}"`)
  expect(a).toBeInTheDocument();
  expect(a.tagName).toEqual("A");
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.