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

Fix broken webapp unit tests #4951

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

Dripcoding
Copy link

@Dripcoding Dripcoding commented Dec 8, 2023

Summary

Fix broken jest unit tests for the web app. Run 'npm run test' to run all tests.

Ticket Link

N/A

Fixes #4944

@mattermost-build
Copy link
Contributor

Hello @Dripcoding,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@marianunez marianunez requested review from M-ZubairAhmed, larkox and sbishel and removed request for larkox and M-ZubairAhmed December 8, 2023 21:33
Copy link
Member

@M-ZubairAhmed M-ZubairAhmed left a comment

Choose a reason for hiding this comment

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

When was this broken ?

webapp/package.json Outdated Show resolved Hide resolved
@M-ZubairAhmed

This comment was marked as resolved.

@Dripcoding
Copy link
Author

Ticket mentions changes to be done in focalboard though not in this

I opened an issue because I saw failing tests when I checked out the main branch.


const card1 = TestBlockFactory.createCard(board)
Copy link
Author

Choose a reason for hiding this comment

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

This function relies on Date.now() to populate the createAt and updatedAt fields when a block is not provided. I created a new function createCardWithBlock and passed it a block stub to make it clearer how card fields are populated for this test suite.

@M-ZubairAhmed
Copy link
Member

Ticket mentions changes to be done in focalboard though not in this

I opened an issue because I saw failing tests when I checked out the main branch.

Oh yeah sorry i mis saw this being opened in the monorepo

@Dripcoding
Copy link
Author

@M-ZubairAhmed I figured out why the tests were failing in the pipeline. Turns out I had a different version of node running locally :]

Pushed the fixes and saw the tests passing when I re-triggered the actions in my forked repo.
https://github.com/Dripcoding/focalboard/actions/runs/7235020646/job/19711988610?pr=2

@@ -30,6 +30,7 @@ jobs:
uses: actions/checkout@v3
with:
path: "focalboard"
ref: ${{ env.BRANCH_NAME }}
Copy link
Author

Choose a reason for hiding this comment

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

this ensures that the feature branch is checked out when the workflows run

@mattermost-build
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Broken Jest unit tests
3 participants