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

Cleanup coverage #2170

Merged
merged 7 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion Backend/Repositories/ProjectRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace BackendFramework.Repositories
{
/// <summary> Atomic database functions for <see cref="Project"/>s </summary>
/// <summary> Atomic database functions for <see cref="Project"/>s. </summary>
[ExcludeFromCodeCoverage]
public class ProjectRepository : IProjectRepository
{
Expand Down
3 changes: 3 additions & 0 deletions Backend/Repositories/SemanticDomainRepository.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using BackendFramework.Interfaces;
using BackendFramework.Models;
Expand All @@ -8,6 +9,8 @@

namespace BackendFramework.Repositories
{
/// <summary> Atomic database functions for the SemanticDomainTree and SemanticDomains collections. </summary>
[ExcludeFromCodeCoverage]
public class SemanticDomainRepository : ISemanticDomainRepository
{
private ISemanticDomainContext _context;
Expand Down
2 changes: 1 addition & 1 deletion Backend/Repositories/UserEditRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace BackendFramework.Repositories
{
/// <summary> Atomic database functions for <see cref="UserEdit"/>s </summary>
/// <summary> Atomic database functions for <see cref="UserEdit"/>s. </summary>
[ExcludeFromCodeCoverage]
public class UserEditRepository : IUserEditRepository
{
Expand Down
2 changes: 1 addition & 1 deletion Backend/Repositories/UserRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace BackendFramework.Repositories
{
/// <summary> Atomic database functions for <see cref="User"/>s </summary>
/// <summary> Atomic database functions for <see cref="User"/>s. </summary>
[ExcludeFromCodeCoverage]
public class UserRepository : IUserRepository
{
Expand Down
2 changes: 1 addition & 1 deletion Backend/Repositories/UserRoleRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace BackendFramework.Repositories
{
/// <summary> Atomic database functions for <see cref="UserRole"/>s </summary>
/// <summary> Atomic database functions for <see cref="UserRole"/>s. </summary>
[ExcludeFromCodeCoverage]
public class UserRoleRepository : IUserRoleRepository
{
Expand Down
2 changes: 1 addition & 1 deletion Backend/Repositories/WordRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace BackendFramework.Repositories
{
/// <summary> Atomic database functions for <see cref="Word"/>s </summary>
/// <summary> Atomic database functions for <see cref="Word"/>s. </summary>
[ExcludeFromCodeCoverage]
public class WordRepository : IWordRepository
{
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# The Combine

[![Frontend Actions Status][github-actions-frontend-badge]][github-actions]
[![Frontend Coverage][frontend-codecov-badge]][codecov]
[![Frontend Coverage][frontend-codecov-badge]][codecov-frontend]

[![Backend Actions Status][github-actions-backend-badge]][github-actions]
[![Backend Coverage][backend-codecov-badge]][codecov]
[![Python Actions Status][github-actions-python-badge]][github-actions]
[![Backend Coverage][backend-codecov-badge]][codecov-backend]

[![CodeQL Actions Status][github-actions-codeql-badge]][github-actions]
[![Python Actions Status][github-actions-python-badge]][github-actions]
[![OSSF Scorecard][github-actions-ossf-badge]][github-actions]

[![GitHub release][github-release-badge]][github-version] [![GitHub version][github-version-badge]][github-version]
![Localization][localization-badge] [![GitHub][github-license-badge]][github-license]
[![Localization][localization-badge]][localization-crowdin] [![GitHub][github-license-badge]][github-license]
[![GitHub contributors][github-contribs-badge]][github-contribs]

[github-actions-frontend-badge]: https://github.com/sillsdev/TheCombine/workflows/frontend/badge.svg
[frontend-codecov-badge]: https://codecov.io/gh/sillsdev/TheCombine/branch/master/graph/badge.svg?flag=frontend
[codecov]: https://codecov.io/gh/sillsdev/TheCombine
[codecov-frontend]: https://app.codecov.io/gh/sillsdev/TheCombine/tree/master/src
[codecov-backend]: https://app.codecov.io/gh/sillsdev/TheCombine/tree/master/Backend
[github-actions-backend-badge]: https://github.com/sillsdev/TheCombine/workflows/backend/badge.svg
[backend-codecov-badge]: https://codecov.io/gh/sillsdev/TheCombine/branch/master/graph/badge.svg?flag=backend
[github-actions-python-badge]: https://github.com/sillsdev/TheCombine/workflows/python/badge.svg
[github-actions-codeql-badge]: https://github.com/sillsdev/TheCombine/workflows/CodeQL/badge.svg
[github-actions-ossf-badge]:
https://github.com/sillsdev/TheCombine/workflows/Scorecards%20supply-chain%20security/badge.svg
[github-actions]: https://github.com/sillsdev/TheCombine/actions
[localization-badge]: https://img.shields.io/badge/localization-En%20Es%20Fr-blue
[localization-badge]: https://img.shields.io/badge/localization-Ar%20En%20Es%20Fr%20Pt-blue
[localization-crowdin]: https://crowdin.com/project/the-combine
[github-version-badge]: https://img.shields.io/github/package-json/v/sillsdev/TheCombine
[github-release-badge]: https://img.shields.io/github/v/release/sillsdev/TheCombine
[github-version]: https://github.com/sillsdev/TheCombine/releases
Expand Down
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ignore:
- "src/api"
- "src/resources"
- "src/types"
- "**/*Mock.ts"
- "**/*Types.ts"
2 changes: 1 addition & 1 deletion src/backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import * as LocalStorage from "backend/localStorage";
import history, { Path } from "browserHistory";
import authHeader from "components/Login/AuthHeaders";
import { errorToast } from "components/Toast/SwalToast";
import { convertGoalToEdit } from "types/goalUtilities";
import { Goal, GoalStep } from "types/goals";
import { RuntimeConfig } from "types/runtimeConfig";
import { Bcp47Code } from "types/writingSystem";
import { convertGoalToEdit } from "utilities/goalUtilities";

export const baseURL = `${RuntimeConfig.getInstance().baseUrl()}`;
const apiBaseURL = `${baseURL}/v1`;
Expand Down
2 changes: 1 addition & 1 deletion src/components/App/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import renderer from "react-test-renderer";
import configureMockStore from "redux-mock-store";
import thunk from "redux-thunk";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { defaultState } from "components/App/DefaultState";
import App from "components/App/component";
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppBar/tests/AppBarComponent.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Provider } from "react-redux";
import renderer from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { Path } from "browserHistory";
import { defaultState } from "components/App/DefaultState";
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppBar/tests/UserMenu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Provider } from "react-redux";
import renderer from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { Path } from "browserHistory";
import UserMenu, { getIsAdmin, UserMenuList } from "components/AppBar/UserMenu";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Provider } from "react-redux";
import renderer, { ReactTestInstance } from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { SemanticDomainFull } from "api";
import DataEntryHeader from "components/DataEntry/DataEntryHeader/DataEntryHeader";
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataEntry/DataEntryTable/DataEntryTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import Recorder from "components/Pronunciations/Recorder";
import { Hash } from "types/hash";
import theme from "types/theme";
import { newSense, simpleWord } from "types/word";
import { firstGlossText } from "types/wordUtilities";
import { defaultWritingSystem, newWritingSystem } from "types/writingSystem";
import { firstGlossText } from "utilities/wordUtilities";

export const exitButtonId = "exit-to-domain-tree";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import renderer from "react-test-renderer";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import DeleteEntry from "components/DataEntry/DataEntryTable/EntryCellComponents/DeleteEntry";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AddComment, Comment } from "@mui/icons-material";
import renderer from "react-test-renderer";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import EntryNote from "components/DataEntry/DataEntryTable/EntryCellComponents/EntryNote";

Expand Down
4 changes: 2 additions & 2 deletions src/components/DataEntry/DataEntryTable/NewEntry/NewEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import Pronunciations from "components/Pronunciations/PronunciationsComponent";
import Recorder from "components/Pronunciations/Recorder";
import theme from "types/theme";
import { newSense, newWord } from "types/word";
import { firstGlossText } from "types/wordUtilities";
import { LevenshteinDistance } from "utilities";
import { LevenshteinDistance } from "utilities/utilities";
import { firstGlossText } from "utilities/wordUtilities";

const idAffix = "new-entry";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Word } from "api/models";
import DomainCell from "goals/ReviewEntries/ReviewEntriesComponent/CellComponents/DomainCell";
import { ReviewEntriesWord } from "goals/ReviewEntries/ReviewEntriesComponent/ReviewEntriesTypes";
import theme from "types/theme";
import { firstGlossText } from "types/wordUtilities";
import { firstGlossText } from "utilities/wordUtilities";

interface SenseDialogProps {
selectedWord: Word;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import renderer from "react-test-renderer";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import NewEntry from "components/DataEntry/DataEntryTable/NewEntry/NewEntry";
import { newSemanticDomain } from "types/semanticDomain";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Provider } from "react-redux";
import renderer from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { Word } from "api/models";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Pronunciations from "components/Pronunciations/PronunciationsComponent";
import Recorder from "components/Pronunciations/Recorder";
import theme from "types/theme";
import { newGloss } from "types/word";
import { firstGlossText } from "types/wordUtilities";
import { firstGlossText } from "utilities/wordUtilities";

const idAffix = "recent-entry";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Provider } from "react-redux";
import renderer from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { Word } from "api/models";
import EditTextDialog from "components/Buttons/EditTextDialog";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import renderer from "react-test-renderer";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { Gloss, SemanticDomain, Sense, Word } from "api/models";
import DataEntryTable, {
Expand All @@ -18,8 +18,8 @@ import {
semDomFromTreeNode,
} from "types/semanticDomain";
import { multiSenseWord, newSense, simpleWord } from "types/word";
import { firstGlossText } from "types/wordUtilities";
import { Bcp47Code } from "types/writingSystem";
import { firstGlossText } from "utilities/wordUtilities";

jest.mock("@mui/material/Autocomplete", () => "div");
jest.mock("notistack", () => ({
Expand Down
2 changes: 1 addition & 1 deletion src/components/GoalTimeline/GoalTimelineComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { withTranslation, WithTranslation } from "react-i18next";
import { getUserRole } from "backend";
import { getCurrentUser } from "backend/localStorage";
import GoalList from "components/GoalTimeline/GoalList";
import { requiredPermission, goalTypeToGoal } from "types/goalUtilities";
import { Goal, GoalsState, GoalType } from "types/goals";
import { requiredPermission, goalTypeToGoal } from "utilities/goalUtilities";

const timelineStyle = {
centerButton: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/GoalTimeline/Redux/GoalActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
} from "goals/MergeDupGoal/Redux/MergeDupActions";
import { StoreState } from "types";
import { StoreStateDispatch } from "types/Redux/actions";
import { convertEditToGoal } from "types/goalUtilities";
import { Goal, GoalStatus, GoalType } from "types/goals";
import { convertEditToGoal } from "utilities/goalUtilities";

// Action Creators

Expand Down
4 changes: 2 additions & 2 deletions src/components/GoalTimeline/tests/GoalActions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import { CreateCharInv } from "goals/CreateCharInv/CreateCharInv";
import { HandleFlags } from "goals/HandleFlags/HandleFlags";
import { MergeDups } from "goals/MergeDupGoal/MergeDups";
import { MergeDupData, MergeStepData } from "goals/MergeDupGoal/MergeDupsTypes";
import { goalDataMock } from "goals/MergeDupGoal/Redux/tests/MockMergeDupData";
import { maxNumSteps } from "types/goalUtilities";
import { goalDataMock } from "goals/MergeDupGoal/Redux/tests/MergeDupDataMock";
import { Goal } from "types/goals";
import { newUser } from "types/user";
import { maxNumSteps } from "utilities/goalUtilities";

jest.mock("goals/MergeDupGoal/Redux/MergeDupActions", () => {
const realMergeDupActions = jest.requireActual(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { Provider } from "react-redux";
import renderer from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { defaultState } from "components/GoalTimeline/DefaultState";
import GoalTimelineWithTranslation, {
GoalTimeline,
} from "components/GoalTimeline/GoalTimelineComponent";
import { goalTypeToGoal } from "types/goalUtilities";
import { Goal, GoalType } from "types/goals";
import { goalTypeToGoal } from "utilities/goalUtilities";

// Mock out HTMLDiv.scrollIntoView function, as it fails in a testing environment
HTMLDivElement.prototype.scrollIntoView = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import renderer from "react-test-renderer";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import Login from "components/Login/LoginPage/LoginComponent";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Login/SignUpPage/SignUpComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import LoadingDoneButton from "components/Buttons/LoadingDoneButton";
import {
meetsPasswordRequirements,
meetsUsernameRequirements,
} from "utilities";
} from "utilities/utilities";

const idAffix = "signUp";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import renderer from "react-test-renderer";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import SignUp from "components/Login/SignUpPage/SignUpComponent";

Expand Down
2 changes: 1 addition & 1 deletion src/components/PageNotFound/tests/component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Provider } from "react-redux";
import renderer from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import PageNotFound from "components/PageNotFound/component";

Expand Down
2 changes: 1 addition & 1 deletion src/components/PasswordReset/ResetPage/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { RouteComponentProps } from "react-router-dom";

import history, { Path } from "browserHistory";
import { RequestState } from "components/PasswordReset/Redux/ResetReduxTypes";
import { meetsPasswordRequirements } from "utilities";
import { meetsPasswordRequirements } from "utilities/utilities";

export interface MatchParams {
token: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/PasswordReset/tests/ResetPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { RouteComponentProps } from "react-router-dom";
import renderer from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { resetFail } from "components/PasswordReset/Redux/ResetActions";
import { RequestState } from "components/PasswordReset/Redux/ResetReduxTypes";
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectExport/DownloadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxT
import { StoreState } from "types";
import { useAppDispatch, useAppSelector } from "types/hooks";
import { themeColors } from "types/theme";
import { getNowDateTimeString } from "utilities";
import { getNowDateTimeString } from "utilities/utilities";

function makeExportName(projectName: string) {
return `${projectName}_${getNowDateTimeString()}.zip`;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectScreen/tests/ChooseProject.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ListItemButton } from "@mui/material";
import renderer from "react-test-renderer";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { Project } from "api/models";
import ChooseProject from "components/ProjectScreen/ChooseProject";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import { getFrontierWords } from "backend";
import IconButtonWithTooltip from "components/Buttons/IconButtonWithTooltip";
import { UpperRightToastContainer } from "components/Toast/UpperRightToastContainer";
import theme from "types/theme";
import { getAnalysisLangsFromWords } from "types/wordUtilities";
import { newWritingSystem, semDomWritingSystems } from "types/writingSystem";
import { getAnalysisLangsFromWords } from "utilities/wordUtilities";

interface LanguageProps extends WithTranslation {
project: Project;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LanguagePicker } from "mui-language-picker";
import renderer from "react-test-renderer";

import "tests/mockReactI18next";
import "tests/reactI18nextMock";

import { Project, WritingSystem } from "api/models";
import ProjectLanguages from "components/ProjectSettings/ProjectLanguages/ProjectLanguages";
Expand Down
Loading