Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/heystone999/memo-minder
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
judepowerful committed Mar 25, 2024
2 parents 934527c + 0fdc8c1 commit 2a62ece
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ jobs:
working-directory: ./memo-backend
github-token: ${{ secrets.TOKEN_FOR_MEMO }}
annotations: none
test-script: npm test
test-script: npm test --ci
custom-title: Coverage report for backend

1 comment on commit 2a62ece

@heystone999
Copy link
Owner

Choose a reason for hiding this comment

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

Coverage report for fronend

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 28.86% 230/797
🔴 Branches 17.59% 57/324
🔴 Functions 18.43% 40/217
🔴 Lines 28.99% 220/759

Test suite run failed

Failed tests: 5/13. Failed suites: 2/4.
  ● updates a habit correctly

    TestingLibraryElementError: Unable to find an element with the text: Drink water. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

    Ignored nodes: comments, script, style
    <body>
      <div>
        <div
          class="taskAreaContainer"
        >
          <div
            class="controlButton"
          >
            <div
              class="clearButtonContainer"
            >
              <button
                class="clearButton"
              >
                Clear and Reset
              </button>
            </div>
            <div
              class="task-button-container"
            >
              <div
                class="add-task-button-container"
              >
                <button
                  class="add-task-button"
                >
                  Add Task
                </button>
              </div>
            </div>
          </div>
          <div
            class="taskAreaSections"
          >
            <div
              class="taskAreaSection"
            >
              <h2>
                Habits
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Good
                </button>
                <button>
                  Bad
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="habitInputContainer"
                >
                  <input
                    class="habitInput"
                    placeholder="Add a habit"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                >
                  <div
                    class="habitItem"
                  >
                    <p />
                  </div>
                </div>
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                Dailies
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Due
                </button>
                <button>
                  Completed
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="dailyInputContainer"
                >
                  <input
                    class="dailyInput"
                    placeholder="Add a daily"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                To Do Lists
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Scheduled
                </button>
                <button>
                  Completed
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="todoInputContainer"
                >
                  <input
                    class="todoInput"
                    placeholder="Add a To Do"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                Rewards
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="rewardInputContainer"
                >
                  <input
                    class="rewardInput"
                    placeholder="Add a Reward"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
          </div>
        </div>
      </div>
    </body>

      83 |   );
      84 |
    > 85 |   const habitItem = screen.getByText('Drink water');
         |                            ^
      86 |   fireEvent.click(habitItem);
      87 |
      88 |   expect(onUpdateHabitMock).not.toHaveBeenCalled();

      at Object.getElementError (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:37:19)
      at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
      at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
      at getByText (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:95:19)
      at Object.<anonymous> (src/component/taskArea/TaskArea.test.js:85:28)

  ● deletes a habit correctly

    TestingLibraryElementError: Unable to find an element with the text: Drink water. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

    Ignored nodes: comments, script, style
    <body>
      <div>
        <div
          class="taskAreaContainer"
        >
          <div
            class="controlButton"
          >
            <div
              class="clearButtonContainer"
            >
              <button
                class="clearButton"
              >
                Clear and Reset
              </button>
            </div>
            <div
              class="task-button-container"
            >
              <div
                class="add-task-button-container"
              >
                <button
                  class="add-task-button"
                >
                  Add Task
                </button>
              </div>
            </div>
          </div>
          <div
            class="taskAreaSections"
          >
            <div
              class="taskAreaSection"
            >
              <h2>
                Habits
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Good
                </button>
                <button>
                  Bad
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="habitInputContainer"
                >
                  <input
                    class="habitInput"
                    placeholder="Add a habit"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                >
                  <div
                    class="habitItem"
                  >
                    <p />
                  </div>
                </div>
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                Dailies
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Due
                </button>
                <button>
                  Completed
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="dailyInputContainer"
                >
                  <input
                    class="dailyInput"
                    placeholder="Add a daily"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                To Do Lists
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Scheduled
                </button>
                <button>
                  Completed
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="todoInputContainer"
                >
                  <input
                    class="todoInput"
                    placeholder="Add a To Do"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                Rewards
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="rewardInputContainer"
                >
                  <input
                    class="rewardInput"
                    placeholder="Add a Reward"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
          </div>
        </div>
      </div>
    </body>

      126 |   );
      127 |
    > 128 |   const habitItem = screen.getByText('Drink water');
          |                            ^
      129 |   fireEvent.click(habitItem);
      130 |
      131 |   const deleteButton = screen.getByText(`Delete this Habit`);

      at Object.getElementError (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:37:19)
      at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
      at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
      at getByText (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:95:19)
      at Object.<anonymous> (src/component/taskArea/TaskArea.test.js:128:28)

  ● updates health when positive habit is clicked

    TestingLibraryElementError: Unable to find an element with the text: +. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

    Ignored nodes: comments, script, style
    <body>
      <div>
        <div
          class="taskAreaContainer"
        >
          <div
            class="controlButton"
          >
            <div
              class="clearButtonContainer"
            >
              <button
                class="clearButton"
              >
                Clear and Reset
              </button>
            </div>
            <div
              class="task-button-container"
            >
              <div
                class="add-task-button-container"
              >
                <button
                  class="add-task-button"
                >
                  Add Task
                </button>
              </div>
            </div>
          </div>
          <div
            class="taskAreaSections"
          >
            <div
              class="taskAreaSection"
            >
              <h2>
                Habits
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Good
                </button>
                <button>
                  Bad
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="habitInputContainer"
                >
                  <input
                    class="habitInput"
                    placeholder="Add a habit"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                >
                  <div
                    class="habitItem"
                  >
                    <p />
                  </div>
                </div>
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                Dailies
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Due
                </button>
                <button>
                  Completed
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="dailyInputContainer"
                >
                  <input
                    class="dailyInput"
                    placeholder="Add a daily"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                To Do Lists
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Scheduled
                </button>
                <button>
                  Completed
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="todoInputContainer"
                >
                  <input
                    class="todoInput"
                    placeholder="Add a To Do"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                Rewards
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="rewardInputContainer"
                >
                  <input
                    class="rewardInput"
                    placeholder="Add a Reward"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
          </div>
        </div>
      </div>
    </body>

      163 |   );
      164 |
    > 165 |   const positiveHabitButton = screen.getByText('+');
          |                                      ^
      166 |   fireEvent.click(positiveHabitButton);
      167 |
      168 |   expect(updateLevelMock).toHaveBeenCalled();

      at Object.getElementError (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:37:19)
      at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
      at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
      at getByText (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:95:19)
      at Object.<anonymous> (src/component/taskArea/TaskArea.test.js:165:38)

  ● updates health when negative habit is clicked

    TestingLibraryElementError: Unable to find an element with the text: -. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

    Ignored nodes: comments, script, style
    <body>
      <div>
        <div
          class="taskAreaContainer"
        >
          <div
            class="controlButton"
          >
            <div
              class="clearButtonContainer"
            >
              <button
                class="clearButton"
              >
                Clear and Reset
              </button>
            </div>
            <div
              class="task-button-container"
            >
              <div
                class="add-task-button-container"
              >
                <button
                  class="add-task-button"
                >
                  Add Task
                </button>
              </div>
            </div>
          </div>
          <div
            class="taskAreaSections"
          >
            <div
              class="taskAreaSection"
            >
              <h2>
                Habits
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Good
                </button>
                <button>
                  Bad
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="habitInputContainer"
                >
                  <input
                    class="habitInput"
                    placeholder="Add a habit"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                >
                  <div
                    class="habitItem"
                  >
                    <p />
                  </div>
                </div>
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                Dailies
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Due
                </button>
                <button>
                  Completed
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="dailyInputContainer"
                >
                  <input
                    class="dailyInput"
                    placeholder="Add a daily"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                To Do Lists
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
                <button>
                  Scheduled
                </button>
                <button>
                  Completed
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="todoInputContainer"
                >
                  <input
                    class="todoInput"
                    placeholder="Add a To Do"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
            <div
              class="taskAreaSection"
            >
              <h2>
                Rewards
              </h2>
              <div
                class="taskAreaNav"
              >
                <button>
                  All
                </button>
              </div>
              <div
                class="contentContainer"
              >
                <div
                  class="rewardInputContainer"
                >
                  <input
                    class="rewardInput"
                    placeholder="Add a Reward"
                    type="text"
                    value=""
                  />
                </div>
                <div
                  class="taskList"
                />
              </div>
            </div>
          </div>
        </div>
      </div>
    </body>

      194 |   );
      195 |
    > 196 |   const negativeHabitButton = screen.getByText('-');
          |                                      ^
      197 |   fireEvent.click(negativeHabitButton);
      198 |
      199 |   expect(updateHealthMock).toHaveBeenCalled();

      at Object.getElementError (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:37:19)
      at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
      at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
      at getByText (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:95:19)
      at Object.<anonymous> (src/component/taskArea/TaskArea.test.js:196:38)


  ● health and level integration test

    TestingLibraryElementError: Unable to find an element with the text: -. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

    Ignored nodes: comments, script, style
    <body>
      <div>
        <div>
          <div>
            <nav>
              <div
                class="nav-left"
              >
                <a
                  class="logo"
                  href="/"
                >
                  MEMO MINDER
                </a>
                <a
                  class=""
                  href="/"
                >
                  <span>
                    Tasks
                  </span>
                </a>
                <a
                  class=""
                  href="/"
                >
                  <span>
                    Shops
                  </span>
                </a>
                <a
                  class=""
                  href="/"
                >
                  <span>
                    Challenges
                  </span>
                </a>
                <a
                  class=""
                  href="/"
                >
                  <span>
                    Milestones
                  </span>
                </a>
              </div>
              <div
                class="nav-middle"
              />
              <div
                class="nav-right"
              >
                <div
                  class="coin"
                >
                  <img
                    alt=""
                    class="coin-icon"
                    src="/coin.png"
                  />
                  <div
                    class="coin-number"
                  >
                    0
                  </div>
                </div>
                <div
                  class="user"
                >
                  <img
                    alt=""
                    class="user-pic"
                    src="/user-pic.png"
                  />
                  <span
                    class="user-name"
                  >
                    Ray
                  </span>
                </div>
              </div>
              <div
                class="user-menu inactive"
              >
                <ul>
                  <li
                    class="user-menu-item"
                  >
                    <a
                      class="logout-link"
                      href="/login"
                    >
                       
                      Log Out
                       
                    </a>
                  </li>
                </ul>
              </div>
            </nav>
            <div
              style="display: flex; flex-direction: column;"
            >
              <div
                class="header"
              >
                <div
                  class="user"
                >
                  <div
                    class="user-character"
                  >
                    <img
                      alt=""
                      class="user-character-pic"
                      src="/char-pic.png"
                    />
                  </div>
                  <div
                    class="user-character-info"
                  >
                    <div
                      class="username"
                    >
                      Ray
                    </div>
                    <div
                      class="user-data"
                    >
                      <div
                        class="health"
                      >
                        <img
                          alt=""
                          src="/heart.png"
                        />
                        <div
                          class="health-bar"
                        >
                          <div
                            class="health-level"
                            style="width: 100%;"
                          />
                        </div>
                        <span>
                          100
                          /100
                        </span>
                      </div>
                      <div
                        class="level"
                      >
                        <img
                          alt=""
                          src="/star.png"
                        />
                        <div
                          class="level-bar"
                        >
                          <div
                            class="level-level"
                            style="width: 0%;"
                          />
                        </div>
                        <span>
                          Level 
                          1
                          : 
                          0
                          /100
                        </span>
                      </div>
                    </div>
                  </div>
                </div>
                <div
                  class="bag"
                >
                  <div
                    class="bag-name"
                  >
                    Bag
                  </div>
                  <div
                    class="bought-items-images"
                  />
                </div>
              </div>
              <div>
                <div
                  class="taskAreaContainer"
                >
                  <div
                    class="controlButton"
                  >
                    <div
                      class="clearButtonContainer"
                    >
                      <button
                        class="clearButton"
                      >
                        Clear and Reset
                      </button>
                    </div>
                    <div
                      class="task-button-container"
                    >
                      <div
                        class="add-task-button-container"
                      >
                        <button
                          class="add-task-button"
                        >
                          Add Task
                        </button>
                      </div>
                    </div>
                  </div>
                  <div
                    class="taskAreaSections"
                  >
                    <div
                      class="taskAreaSection"
                    >
                      <h2>
                        Habits
                      </h2>
                      <div
                        class="taskAreaNav"
                      >
                        <button>
                          All
                        </button>
                        <button>
                          Good
                        </button>
                        <button>
                          Bad
                        </button>
                      </div>
                      <div
                        class="contentContainer"
                      >
                        <div
                          class="habitInputContainer"
                        >
                          <input
                            class="habitInput"
                            placeholder="Add a habit"
                            type="text"
                            value=""
                          />
                        </div>
                        <div
                          class="taskList"
                        />
                      </div>
                    </div>
                    <div
                      class="taskAreaSection"
                    >
                      <h2>
                        Dailies
                      </h2>
                      <div
                        class="taskAreaNav"
                      >
                        <button>
                          All
                        </button>
                        <button>
                          Due
                        </button>
                        <button>
                          Completed
                        </button>
                      </div>
                      <div
                        class="contentContainer"
                      >
                        <div
                          class="dailyInputContainer"
                        >
                          <input
                            class="dailyInput"
                            placeholder="Add a daily"
                            type="text"
                            value=""
                          />
                        </div>
                        <div
                          class="taskList"
                        >
                          <div
                            class="dailyItem "
                          >
                            <button>
                              +
                            </button>
                            <p>
                              Your default daily
                            </p>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div
                      class="taskAreaSection"
                    >
                      <h2>
                        To Do Lists
                      </h2>
                      <div
                        class="taskAreaNav"
                      >
                        <button>
                          All
                        </button>
                        <button>
                          Scheduled
                        </button>
                        <button>
                          Completed
                        </button>
                      </div>
                      <div
                        class="contentContainer"
                      >
                        <div
                          class="todoInputContainer"
                        >
                          <input
                            class="todoInput"
                            placeholder="Add a To Do"
                            type="text"
                            value=""
                          />
                        </div>
                        <div
                          class="taskList"
                        >
                          <div
                            class="todoItem "
                          >
                            <button>
                              +
                            </button>
                            <p>
                              Your default to-do
                            </p>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div
                      class="taskAreaSection"
                    >
                      <h2>
                        Rewards
                      </h2>
                      <div
                        class="taskAreaNav"
                      >
                        <button>
                          All
                        </button>
                      </div>
                      <div
                        class="contentContainer"
                      >
                        <div
                          class="rewardInputContainer"
                        >
                          <input
                            class="rewardInput"
                            placeholder="Add a Reward"
                            type="text"
                            value=""
                          />
                        </div>
                        <div
                          class="taskList"
                        >
                          <div
                            class="rewardItem"
                          >
                            <button>
                              10
                               coins
                            </button>
                            <p>
                              Your default reward
                            </p>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </body>

      12 |
      13 |     // Trigger a negative habit click
    > 14 |     fireEvent.click(screen.getByText('-'));
         |                            ^
      15 |
      16 |     // Health should decrease by 10
      17 |     expect(screen.getByText('90/100')).toBeInTheDocument();

      at Object.getElementError (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:37:19)
      at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
      at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
      at getByText (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:95:19)
      at Object.<anonymous> (src/tests/AppIntegration.test.js:14:28)

Report generated by 🧪jest coverage report action from 2a62ece

Please sign in to comment.