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

Add 'Manage' tab to Digital Twins page preview #957

Conversation

VanessaScherma
Copy link
Contributor

It replaces PR #906. it adds the 'Manage' tab to Digital Twins page preview. It includes the functionality ‘Details’ to read the README.md file, ‘Delete’ to delete the DT folder from the GitLab profile, ‘Reconfigure’ to edit the DT files.

setConfigData(digitalTwin.configFiles.map((name) => ({ id: name, name })));
};

const handleFileClick = async (
Copy link

Choose a reason for hiding this comment

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

Function handleFileClick has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.

setShowLog(false);
};

function ReconfigureDialog({
Copy link

Choose a reason for hiding this comment

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

Function ReconfigureDialog has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.

setOpenCancelDialog(false);
};

const handleConfirmSave = async () => {
Copy link

Choose a reason for hiding this comment

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

Function handleConfirmSave has 31 lines of code (exceeds 25 allowed). Consider refactoring.

@prasadtalasila
Copy link
Contributor

@VanessaScherma remember to address issue #953

@prasadtalasila
Copy link
Contributor

@VanessaScherma The tests are missing. Are you working on them?

@prasadtalasila
Copy link
Contributor

Testcases and error messages to check for the PR:

  1. Target gitlab project repo exists and public
  2. Target gitlab project repo exists but private
  3. Target gitlab project repo does not exist
  4. User does not have access to the target gitlab project repo
  5. Catch CORS error when trying to access the target gitlab project repo

Question: can these go into end-to-end tests or should these be manual tests for now?

@VanessaScherma
Copy link
Contributor Author

@VanessaScherma The tests are missing. Are you working on them?

Yes, I will complete them as soon as possible.

);
}

const saveChanges = async (
Copy link

Choose a reason for hiding this comment

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

Function saveChanges has 27 lines of code (exceeds 25 allowed). Consider refactoring.

@prasadtalasila prasadtalasila added this to the Release v0.6.0 milestone Oct 11, 2024
@prasadtalasila
Copy link
Contributor

@VanessaScherma This PR brings nice working features. I am only half way through the code review and can suggest the following changes for now.

  1. If there is a simple way (less than one hour of work) to introduce scroll behavior using up-down arrows that would be nice.

  2. Please move this text
    "This page demonstrates integration of DTaaS with gitlab CI/CD workflows. The feature is experimental and requires certain gitlab setup in order for it to work."
    to top of page, i.e., before Manage-Execute react tabs.

    The text for Manage and Execute Tabs is:
    Manage: Check the Digital Twins and if necessary modify the same using reconfigure button.
    The most useful modification is the reconfiguration of the Digital Twins.
    Execute: Execute the Digital Twins using Gitlab CI/CD workflows.

  3. When the side-menu opens, the order of items should be:

    Description
      all markdown files
    Configuration
      json and yaml files even dot files (at the moment the yaml files are not visible)
    Lifecycle
      all the files available in lifecycle/ directory
  4. Does the Manage tab load even if "description.md" does not exist for a DT? The description of
    a digital twin could be left empty, if the matching "description.md" could not be found.

  5. The editor/Sidebar.tsx uses dedicated SimpleTreeView for Description, Lifecycle and Configuration.
    If a single SimpleTreeView is used for these three, then hiding of items is possible. Please
    see the simple example on this MUI docs page

@prasadtalasila
Copy link
Contributor

@VanessaScherma update to text description

To the top-of the DT preview page (before the React Tabs):
"This page demonstrates integration of DTaaS with gitlab CI/CD workflows. The feature is experimental and requires certain gitlab setup in order for it to work."

const tabs: ITabs[] = [
  {
  ...
  {
    label: 'Manage',
    body: `Read the complete description of digital twins. If necessary, users can delete a digital twin, removing it from the workspace with all its associated data. Users can also reconfigure the digital twin.`,
  },
  {
    label: 'Execute',
    body: 'Execute the Digital Twins using Gitlab CI/CD workflows.',
  },
  ...
];

Copy link
Contributor

@prasadtalasila prasadtalasila left a comment

Choose a reason for hiding this comment

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

@VanessaScherma The review is now complete. Please let me know when you are done with the changes and tests. Thanks.

name: string;
}

const handleCloseLog = (setShowLog: Dispatch<SetStateAction<boolean>>) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be named handleDetailsDialogue?

Copy link
Contributor Author

@VanessaScherma VanessaScherma Oct 14, 2024

Choose a reason for hiding this comment

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

Changed into handleCloseDetailsDialog. The name of this function has been also changed accordingly in the other Dialogs.

import { selectDigitalTwinByName } from '../../../store/digitalTwin.slice';
import DigitalTwin from '../../../util/gitlabDigitalTwin';

interface SidebarProps {
Copy link
Contributor

Choose a reason for hiding this comment

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

These seem to be DTItemProps. These are rather the properties of a side bar item received from digital twin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are the props passed to the Sidebar component from the parent component Editor.

setShowLog: Dispatch<React.SetStateAction<boolean>>;
}

const handleToggleLog = (setShowLog: Dispatch<SetStateAction<boolean>>) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

The purpose of the function is unclear. The delete button is on Manage tab where there is no need for log dialogue.

Copy link
Contributor Author

@VanessaScherma VanessaScherma Oct 14, 2024

Choose a reason for hiding this comment

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

The function has been renamed handleToggleDeleteDialog. Its purpose is to open the DeleteDialog component when the button is clicked.

setShowLog: Dispatch<React.SetStateAction<boolean>>;
}

export const handleToggleLog = async (
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it handleDetailsWindow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function has been renamed handleToggleDetailsDialog.

setShowReconfigure: Dispatch<SetStateAction<boolean>>;
}

const handleToggleReconfigure = (
Copy link
Contributor

Choose a reason for hiding this comment

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

The Reconfigure button is never inactive. The original html page and all the related React components are active in the background. Is there a need to deactivate the Details button. Perhaps you intend to use this click action to show README in which case the code structure and names have to reflect that intention?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function has been changed into handleToggleReconfigureDialog and it is used to open the ReconfigureDialog by clicking on the ReconfigureButton. Both the ReconfigureButton and the DetailsButton are never deactivated. If there are no files within the DT folder on GitLab, the ReconfigureDialog shows the empty SimpleTreeView (while maintaining the ‘Description’, ‘Lifecycle’, ‘Configuration’ sections). If there is no README.md, the DetailsDialog informs of the absence of that file within the GitLab folder. Is that what you mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

An updated message: "There is no README.md file for the hello-world digital twin"

{tab === 'Execute' ? (
<AssetCardExecute asset={asset} />
) : (
<AssetCardManage asset={asset} onDelete={() => onDelete(asset.path)} />
Copy link
Contributor

Choose a reason for hiding this comment

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

There are also "details" and "reconfigure" buttons. Why are they treated differently from delete button?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The onDelete function is passed exclusively to AssetCardManage, which includes the Delete button. This is because it is the only button that, in addition to having an API call via gitlabDigitalTwin, must also modify the store via dispatch with the deleteAsset function.

fileType: string;
}

function PreviewTab({ fileContent, fileType }: PreviewProps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. The md, json and yaml cases are handled. What happens if it is lifecycle/script?
  2. The hidden files (starting with dot character) should also be available. This allows us to edit .gitlab-ci.yaml file as well.

Copy link
Contributor Author

@VanessaScherma VanessaScherma Oct 14, 2024

Choose a reason for hiding this comment

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

  1. Added case for handling bash files, without extension.
  2. The yaml files are now included in the 'Configuration' section.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is not just the bash files. Please show all the files placed in lifecycle directory

const handleDelete = async (
digitalTwin: DigitalTwin,
setShowLog: Dispatch<SetStateAction<boolean>>,
onDelete: () => void,
Copy link
Contributor

Choose a reason for hiding this comment

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

onDelete function is void everywhere in the codebase. Is it needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it does not have a return value but modifies the store via dispatch.

client/src/preview/util/gitlabDigitalTwin.ts Outdated Show resolved Hide resolved
const filteredFiles = response
.filter(
(item: { type: string; name: string }) =>
item.type === 'blob' && item.name.endsWith('.json'),
Copy link
Contributor

Choose a reason for hiding this comment

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

The yaml file extension gets added here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

);
});

it('should get description files', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

expect(dt.descriptionFiles).toEqual([]);
});

it('should get lifecycle files', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

expect(dt.lifecycleFiles).toEqual([]);
});

it('should get config files', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

expect(dt.descriptionFiles).toEqual(['file1.md']);
});

it('should return empty array when fetching description files fails', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

expect(dt.lifecycleFiles).toEqual(['file2.json']);
});

it('should return empty array when fetching lifecycle files fails', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

expect(dt.configFiles).toEqual(['file2.json']);
});

it('should return empty array when fetching config files fails', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

import * as React from 'react';

describe('PreviewTab', () => {
it('renders PreviewTab with markdown content', () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

expect(screen.getByText('fileContent')).toBeInTheDocument();
});

it('renders PreviewTab with json content', () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

expect(screen.getByText('fileContent')).toBeInTheDocument();
});

it('renders PreviewTab with yaml content', () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

import { showSnackbar } from 'preview/store/snackbar.slice';
import { mockDigitalTwin } from 'test/preview/__mocks__/global_mocks';

jest.mock('react-redux', () => ({
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

@VanessaScherma
Copy link
Contributor Author

@VanessaScherma This PR brings nice working features. I am only half way through the code review and can suggest the following changes for now.

1. If there is a simple way (less than one hour of work) to introduce scroll behavior using up-down arrows that would be nice.

2. Please move this text
   "This page demonstrates integration of DTaaS with gitlab CI/CD workflows. The feature is experimental and requires certain gitlab setup in order for it to work."
   to top of page, i.e., before Manage-Execute react tabs.
   The text for Manage and Execute Tabs is:
   **Manage**: Check the Digital Twins and if necessary modify the same using _reconfigure_ button.
   The most useful modification is the reconfiguration of the Digital Twins.
   **Execute**: Execute the Digital Twins using Gitlab CI/CD workflows.

3. When the side-menu opens, the order of items should be:
   ```
   Description
     all markdown files
   Configuration
     json and yaml files even dot files (at the moment the yaml files are not visible)
   Lifecycle
     all the files available in lifecycle/ directory
   ```

4. Does the Manage tab load even if "description.md" does not exist for a DT? The description of
   a digital twin could be left empty, if the matching "description.md" could not be found.

5. The `editor/Sidebar.tsx` uses dedicated SimpleTreeView for Description, Lifecycle and Configuration.
   If a single SimpleTreeView is used for these three, then hiding of items is possible. Please
   see the simple example on [this MUI docs page](https://mui.com/x/react-tree-view/getting-started/#render-your-first-component)
  1. Where should I enter the scroll behaviour? Within the ReconfigureDialog to scroll the different files? If so, it is already implemented using a single SimpleTreeView.
  2. Done.
  3. Done.
  4. Done. Now the description remains empty if there is no description.md file.
  5. Done.

dt = new DigitalTwin('test-DTName', mockGitlabInstance);
});

it('should get description files', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

);
});

it('should get lifecycle files', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

);
});

it('should get config files', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

);
});

it('should get description files', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

}}
>
<SimpleTreeView>
<TreeItem itemId="description" label="Description">
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

))}
</TreeItem>

<TreeItem itemId="configuration" label="Configuration">
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

))}
</TreeItem>

<TreeItem itemId="lifecycle" label="Lifecycle">
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.


const files = [{ name: 'Asset 1', content: 'content1', isModified: false }];

const store = configureStore({
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

{ name: 'Asset 1', content: 'content1', isModified: false },
];

const store = configureStore({
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

const digitalTwin = new DigitalTwin('Asset 1', mockGitlabInstance);
digitalTwin.getFileContent = jest.fn().mockResolvedValueOnce(null);

await React.act(async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

jest.clearAllMocks();
});

it('calls handleFileClick when a description file is clicked', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

});
});

it('calls handleFileClick when a configuration file is clicked', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

});
});

it('calls handleFileClick when a lifecycle file is clicked', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

);
});

it('calls handleFileClick when a description file is clicked', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

fireEvent.click(file);
});

it('calls handleFileClick when a lifecycle file is clicked', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

jest.clearAllMocks();
});

it('calls handleFileClick when a description file is clicked', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

fireEvent.click(file);
});

it('calls handleFileClick when a config file is clicked', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

});
});

it('calls handleFileClick when a configuration file is clicked', async () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

@@ -0,0 +1,311 @@
import AssetBoard from 'preview/components/asset/AssetBoard';
Copy link

Choose a reason for hiding this comment

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

File Manage.test.tsx has 257 lines of code (exceeds 250 allowed). Consider refactoring.

}),
});

const setupTest = () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

}),
});

const setupTest = () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

}),
});

const setupTest = () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

{ name: 'Asset 1', content: 'content1', isModified: false },
];

const store = configureStore({
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 4 locations. Consider refactoring.

{ name: 'Asset 1', content: 'content1', isModified: false },
];

const store = configureStore({
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 4 locations. Consider refactoring.

describe('DeleteDialog', () => {
let store: ReturnType<typeof setupStore>;

beforeEach(() => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

describe('DetailsDialog', () => {
let store: ReturnType<typeof setupStore>;

beforeEach(() => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

describe('ReconfigureDialog', () => {
let store: ReturnType<typeof setupStore>;

beforeEach(() => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

Copy link

codecov bot commented Oct 20, 2024

Codecov Report

Attention: Patch coverage is 82.41379% with 51 lines in your changes missing coverage. Please review.

Project coverage is 65.16%. Comparing base (eaa22d5) to head (78335aa).
Report is 36 commits behind head on feature/distributed-demo.

Current head 78335aa differs from pull request most recent head dd7cc86

Please upload reports for the commit dd7cc86 to get more accurate results.

Files with missing lines Patch % Lines
client/src/preview/util/gitlabDigitalTwin.ts 32.65% 26 Missing and 7 partials ⚠️
...rc/preview/route/digitaltwins/editor/EditorTab.tsx 70.58% 4 Missing and 1 partial ⚠️
...c/preview/route/digitaltwins/editor/PreviewTab.tsx 80.00% 0 Missing and 3 partials ⚠️
.../src/preview/route/digitaltwins/editor/Sidebar.tsx 92.68% 0 Missing and 3 partials ⚠️
...preview/route/digitaltwins/DigitalTwinsPreview.tsx 0.00% 1 Missing and 1 partial ⚠️
...ew/route/digitaltwins/manage/ReconfigureDialog.tsx 95.91% 1 Missing and 1 partial ⚠️
client/src/preview/store/file.slice.ts 86.66% 0 Missing and 2 partials ⚠️
client/src/preview/store/digitalTwin.slice.ts 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           feature/distributed-demo     #957      +/-   ##
============================================================
- Coverage                     66.49%   65.16%   -1.33%     
============================================================
  Files                            31       59      +28     
  Lines                           394     1091     +697     
  Branches                         26       78      +52     
============================================================
+ Hits                            262      711     +449     
- Misses                          117      303     +186     
- Partials                         15       77      +62     
Files with missing lines Coverage Δ
client/src/page/Layout.tsx 100.00% <ø> (ø)
client/src/preview/components/asset/AssetBoard.tsx 94.73% <100.00%> (ø)
client/src/preview/components/asset/AssetCard.tsx 100.00% <100.00%> (ø)
...ient/src/preview/components/asset/DeleteButton.tsx 100.00% <100.00%> (ø)
...ent/src/preview/components/asset/DetailsButton.tsx 100.00% <100.00%> (ø)
...src/preview/components/asset/ReconfigureButton.tsx 100.00% <100.00%> (ø)
...ew/route/digitaltwins/DigitalTwinTabDataPreview.ts 100.00% <ø> (ø)
...t/src/preview/route/digitaltwins/editor/Editor.tsx 100.00% <100.00%> (ø)
...preview/route/digitaltwins/manage/DeleteDialog.tsx 100.00% <100.00%> (ø)
...review/route/digitaltwins/manage/DetailsDialog.tsx 100.00% <100.00%> (ø)
... and 14 more

... and 21 files with indirect coverage changes

Components Coverage Δ
Website 65.16% <74.13%> (-1.33%) ⬇️
Lib Microservice ∅ <ø> (∅)

@VanessaScherma
Copy link
Contributor Author

@prasadtalasila, here are updates on testing.

Rows uncovered, both in unit and integration tests:

  • 158 of ReconfigureDialog (already mentioned at the last meeting). Although closing the Dialog is tested (and the test works correctly), the onClose line is not covered, unlike the other Dialogs present and tested.
  • 20-24, 48 of EditorTab. onChange within the textbox is tested, however the rows are not covered due to the use of Monaco Editor. As read from this issue (link) it is not recommended to test Monaco Editor due to complexity, preferring to use other frameworks.

Also, there remains a duplication problem on CodeClimate. Despite having created a util function for store setup, the call to the function, followed by rendering the component, is considered duplication. Any ideas on how to fix this?

Thank you.

@prasadtalasila
Copy link
Contributor

@prasadtalasila, here are updates on testing.

Rows uncovered, both in unit and integration tests:

  • 158 of ReconfigureDialog (already mentioned at the last meeting). Although closing the Dialog is tested (and the test works correctly), the onClose line is not covered, unlike the other Dialogs present and tested.
  • 20-24, 48 of EditorTab. onChange within the textbox is tested, however the rows are not covered due to the use of Monaco Editor. As read from this issue (link) it is not recommended to test Monaco Editor due to complexity, preferring to use other frameworks.

Also, there remains a duplication problem on CodeClimate. Despite having created a util function for store setup, the call to the function, followed by rendering the component, is considered duplication. Any ideas on how to fix this?

Thank you.

@VanessaScherma
Thanks for the updates. Please ignore codeclimate issues. The test coverage seems fine. I will have a look at the code one more time.

Copy link

codeclimate bot commented Oct 22, 2024

Code Climate has analyzed commit dd7cc86 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 3

View more on Code Climate.

@prasadtalasila prasadtalasila merged commit 54f6dbe into INTO-CPS-Association:feature/distributed-demo Oct 22, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants