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

Bug Report : Visiting advertisement throws error #1092

Closed
pateldivyesh1323 opened this issue Nov 25, 2023 · 10 comments · Fixed by #1097
Closed

Bug Report : Visiting advertisement throws error #1092

pateldivyesh1323 opened this issue Nov 25, 2023 · 10 comments · Fixed by #1097
Assignees
Labels
bug Something isn't working

Comments

@pateldivyesh1323
Copy link
Contributor

Describe the bug
Visiting created advertisement shows error.
endDate.toDateString is not a function

To Reproduce
Steps to reproduce the behavior:

  1. Login as Super admin
  2. Go to advertisements page
  3. Create a new advertisement if there is not any
  4. See the error

Expected behavior

endDate should be passed as a Date object to use toDateString() function.

Actual behavior

endDate is passes as string which throws the error.

Screenshots
image

Additional details

I would like to work on this.

@palisadoes
Copy link
Contributor

Make sure the tests for the file(s) you are modifying have 100% code coverage when complete

@pateldivyesh1323
Copy link
Contributor Author

@palisadoes The file I need to modify has only 45% test coverage, so do I need to write more test?

@palisadoes
Copy link
Contributor

Yes to get it to 100% coverage. We are currently at an unacceptable level across the repository code base.

@AmitSharma512
Copy link
Contributor

@palisadoes I have fixed the above bug, and some more bug which were on the advertisement page after solving the above bug like :

  1. if we create one advertisement, we get to see 4 cards of same advertisement on the active advertisement page.
  2. the link which we provide while creating advertisement was also not visible on the card.
    so , I have fixed all the above issues.

@palisadoes
Copy link
Contributor

  1. @AmitSharma512 Thanks for your enthusiasm. Let's give @pateldivyesh1323 a chance.
  2. @pateldivyesh1323 Please work with @noman2002 on any future questions related to this issue or the resulting PR.

@pateldivyesh1323
Copy link
Contributor Author

Hello @noman2002, I am new to writing test, I used npm run test --watchAll=false /path/to/test/file command to test individual file, but it shows 0 test found.

@noman2002
Copy link
Member

@pateldivyesh1323 Did you used the correct relative path ?

@pateldivyesh1323
Copy link
Contributor Author

@noman2002 Thankyou problem was with path I was using src\components\Advertisements\core\AdvertisementEntry\AdvertisementEntry.test.tsx, instead of src/components/Advertisements/core/AdvertisementEntry/AdvertisementEntry.test.tsx.

@SiddheshKukade
Copy link
Member

@pateldivyesh1323 have you followed the steps shown in the YouTube video of advertisements ?

@pateldivyesh1323
Copy link
Contributor Author

@SiddheshKukade Yes, I saw the video and followed steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants