Giter Site home page Giter Site logo

quest's Issues

Questions list display all questions likes as 0

Description

all questions "likes" are 0, even tho when they're not
this is a question in home directory where the bug appears
image
this is the question in /question/
image

The Problem

this is due to a bug in QPaper specifically line 122 in {utils.getLikes(question.likes)}

How to fix it

update line 122 to {utils.getLikes(question)} instead.

Add comment form is not cleared when a new comment is created

Expected Behavior

AddCommentForm textfield should be cleared when a new comment is submitted and created.

Current Behavior

When a user adds a new comment, that is by typing a valid content in the comment textfield and presses the submit button, a new comment is added, and the comment content stays written in the comment textfield

Possible Solution

pass setCommentContent('') as an argument to dispatch(), like this: dispatch(setCommentContent(''))

Steps to Reproduce

  1. login to the platform
  2. create a question
  3. add a comment to that question

Add question fields information for forms

a card should be added to all forms, the card should contain all the necessary information about the forms

Example: SignupForm card should have something like

  • username must have more than 3 characters and less than 64 characters
  • date of birth must be between 1900 and 2020
    .. etc

NewQuestionForm tag validation

tag validation is supposed to allow tags like this:
first, second, last
but currently it allows first second last
i traced this back to the regex in validator.js line 30, a potential fix would be allowing tags to be seperated by space and not commas, its cleaner and easier to use.

Add fields tests for QPaper

Description

QPaper.test.js doesn't have "rendered data tests", which lead to a logic error as shown in issue #14

what should be added

two checks must be added, preferably after line 35:

expect(getByTestId('title').textContent).toBe(question.title)
expect(parseInt(getByTestId('likes').textContent, 10)).toBe(utils.getLikes(question.likes)) 

aside from that, the mocked question has 0 likes, another question should be created, that contains likes, and the component will be tested again

possible fix

create a test called "renders QPaper" that asserts that the fields are rendered properly, with 2 different questions

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.