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

Automated testing for bug log page (User Story 2) #38

Open
wants to merge 69 commits into
base: f24
Choose a base branch
from
Open

Conversation

lhitmi
Copy link

@lhitmi lhitmi commented Oct 18, 2024

I have created automated tests that cover all the functionalities of the public/admin/dashboard/bug-logs.js page, including data storage. The tests are located in test/bug-logs.js.

These tests use a mock document object to simulate a browser environment. A custom querySelectorAll method is defined to return mock elements for specific selectors, such as #bug-logs-container and #bug-report-description. These mock elements replicate basic properties and methods of real DOM elements, ensuring realistic simulation for testing purposes.

This completes issue #39

@lhitmi lhitmi added the backend main code is written in backend label Oct 19, 2024
@lhitmi lhitmi added this to the Sprint 2 milestone Oct 19, 2024
@lhitmi lhitmi self-assigned this Oct 19, 2024
@lhitmi lhitmi linked an issue Oct 19, 2024 that may be closed by this pull request
@aattiyah aattiyah changed the title automated Testing for bug log page Automated Testing for bug log page (User Story 2) Oct 19, 2024
@aattiyah aattiyah added the Test This tests features that were implemented label Oct 19, 2024
@coveralls
Copy link

coveralls commented Oct 19, 2024

Pull Request Test Coverage Report for Build 11496174786

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 17 of 36 (47.22%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 82.643%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/topics/create.js 6 9 66.67%
src/controllers/admin/dashboard.js 6 22 27.27%
Files with Coverage Reduction New Missed Lines %
src/socket.io/topics.js 1 89.92%
Totals Coverage Status
Change from base Build 11057241668: -0.04%
Covered Lines: 22370
Relevant Lines: 25650

💛 - Coveralls

@aattiyah aattiyah changed the title Automated Testing for bug log page (User Story 2) Automated testing for bug log page (User Story 2) Oct 19, 2024
Copy link

@aattiyah aattiyah left a comment

Choose a reason for hiding this comment

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

Looks good to me

@lhitmi lhitmi changed the base branch from f24 to linking-database-with-bug-log October 20, 2024 13:03
@lhitmi lhitmi changed the base branch from linking-database-with-bug-log to f24 October 20, 2024 13:07
Copy link

@akobaidan akobaidan left a comment

Choose a reason for hiding this comment

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

The tests cover all key functionalities of the bug-log feature and behavior, specifically addressing data storage.

The use of querySelectorAll to mock and return elements, such as #bug-logs-container and #bug-report-description effectively simulates the environment to validate functionality. Moreover, realistic simulation of DOM interactions with mock elements guarantees that the page behaves correctly with regards to data handling.

This approach keeps the tests thorough and isolated from external dependencies. Thus, the code is ready for merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend main code is written in backend Test This tests features that were implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automated testing for bug log page
4 participants