Skip to content

Commit c7324d2

Browse files
committed
Merge branch 'dev' into liam/screenshots
2 parents 0ab8a91 + 67476af commit c7324d2

File tree

4 files changed

+64
-72
lines changed

4 files changed

+64
-72
lines changed

CHANGE_LOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ Changes:<br>
3030
- Publish/Unpublish Button:
3131
- Publish feature on the web app allows users to publish their saved project files into the Marketplace from the main app page
3232
- Dynamically switches between publish/unpublish depending on whether the loaded project is in the Marketplace
33-
- Bug Fixes:
34-
-
3533

3634
Recommendations for Future Enhancements:<br>
3735

@@ -43,6 +41,7 @@ Recommendations for Future Enhancements:<br>
4341
- Modularize appStateSlice file. Further modularization is needed for readability and maintainability.
4442
- Solve residual bugs. Undo & Redo buttons on customization page not functioning as expected. Backend bugs persist as seen in the console when running the dev environment. Resolve electron app functionality to coincide with web app functionality.
4543
- Take a look at the join room functionality using web sockets in order to allow users to collaborate on the same project at the same time.
44+
- For the state manager option in the data table there is a MuiData-menu that is not visible when clicking it and after the filter option is clicked it creates a white space in the bottom of the page.
4645
- Continue code cleanup. Continue cleanup of outdated and unused code and files
4746

4847
**Version 16.0.0 Changes**

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,12 @@ If you want to read about using ReacType, the [User Manual](https://reactype-1.h
6363

6464
## Changes with version 17.0.0
6565

66-
- **Improved Testing Coverage**: Testing coverage now sits at XX%.
67-
- **Typescript Conversion**: Typescript coverage now sits at XX%.
66+
- **Improved Testing Coverage**: Testing coverage now sits at ~60%.
67+
- **Typescript Conversion**: Typescript coverage now sits at ~80%.
6868
- **UI Overhaul**: Upgraded the UI of the application with a more modern style and better developer experience
6969
- **Marketplace Feature**: Implemented a dedicated area for developers to share their projects,
7070
- **And more:** See [change log](https://github.com/open-source-labs/ReacType/blob/master/CHANGE_LOG.md) for more details on what was changed from the previous versions as well as plans for upcoming features!
7171

72-
## Changes with version 16.0.0
73-
74-
- **Improved Testing Coverage**: Testing coverage has now doubled since version 15, and now sits at just over 50% coverage. Version 16 introduces end-to-end testing with Playwright and adds additional unit testing with React Testing Library.
75-
- **Major Bug Fixes**: Manage Project Features now work as expected. State Manager now deletes state from parent components. Context Manager Display Tab and CSS Editor now rendering as expected.
76-
- **Typescript Conversion**: Typescript coverage has improved from 30% to 80% with additional interfaces added for quality improvements.
77-
- **Live CSS Demo Rendering**: CSS Editor changes now rendered visually in the demo page on save.
78-
- **Universal Exports on Web App**: Export feature on web app now allows users to download the current project as a zip file with modularized component folder, html, and css file included. Export feature is now available to all users including guests.
79-
- **UI Improvements**: Fixed multiple contrast issues with white text displaying on white background. Adjusted context manager interface for improved UX. Fixed border styling within modals and error messages.
80-
- **And more:** See [change log](https://github.com/open-source-labs/ReacType/blob/master/CHANGE_LOG.md) for more details on what was changed from the previous versions as well as plans for upcoming features!
81-
8272
## File Structure courtesy of Reactype version 14.0.0
8373

8474
Here is the main file structure:

__tests__/NavBar.test.tsx

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ import '@testing-library/jest-dom/extend-expect';
44
import { MemoryRouter } from 'react-router-dom';
55
import { ThemeProvider, createTheme } from '@mui/material/styles';
66
import NavBar from '../app/src/components/top/NavBar';
7-
import navBarButtons from '../app/src/components/top/NavBarButtons';
87
import * as projectFunctions from '../app/src/helperFunctions/projectGetSaveDel';
98
import { Provider } from 'react-redux';
9+
import { act } from 'react-dom/test-utils';
1010
import { configureStore } from '@reduxjs/toolkit';
1111
import rootReducer from '../app/src/redux/reducers/rootReducer';
1212
import { initialState as appStateInitialState } from '../app/src/redux/reducers/slice/appStateSlice';
1313

14-
15-
1614
// Mock the non-serializable HTMLTypes
1715
const mockHTMLTypes = [
1816
{
@@ -47,7 +45,6 @@ const mockHTMLTypes = [
4745
},
4846
];
4947

50-
5148
// Mocking the theme
5249
const theme = createTheme({
5350
spacing: (value) => `${value}px`,
@@ -117,8 +114,10 @@ describe('NavBar Component', () => {
117114

118115
console.log('After rendering NavBar');
119116

120-
const publishButton = getByText('Publish');
121-
fireEvent.click(publishButton);
117+
await act(async () => {
118+
const publishButton = getByText('Publish');
119+
fireEvent.click(publishButton);
120+
});
122121
});
123122

124123
it('handles publish correctly with new project', async () => {
@@ -147,26 +146,27 @@ describe('NavBar Component', () => {
147146

148147
console.log('After rendering NavBar');
149148

150-
// Check if the "Publish" button is present
151-
const publishButton = queryByText('Publish');
149+
await act(async () => {
150+
// Check if the "Publish" button is present
151+
const publishButton = queryByText('Publish');
152152

153-
if (publishButton) {
154-
fireEvent.click(publishButton);
155-
} else {
156-
// If "Publish" button is not found, look for the "Unpublish" button
157-
const unpublishButton = getByText('Unpublish');
158-
fireEvent.click(unpublishButton);
159-
}
153+
if (publishButton) {
154+
fireEvent.click(publishButton);
155+
} else {
156+
// If "Publish" button is not found, look for the "Unpublish" button
157+
const unpublishButton = getByText('Unpublish');
158+
fireEvent.click(unpublishButton);
159+
}
160160

161-
// Check if the modal for a new project is displayed
162-
const projectNameInput = queryByTestId('project-name-input');
161+
// Check if the modal for a new project is displayed
162+
const projectNameInput = queryByTestId('project-name-input');
163163

164-
if (projectNameInput) {
165-
// entering a project name in the modal
166-
fireEvent.change(projectNameInput, { target: { value: 'My Project' } });
167-
}
164+
if (projectNameInput) {
165+
// entering a project name in the modal
166+
fireEvent.change(projectNameInput, { target: { value: 'My Project' } });
167+
}
168168
});
169-
169+
});
170170

171171
it('handles unpublish correctly', async () => {
172172
const unpublishProjectMock = jest.spyOn(projectFunctions, 'unpublishProject');
@@ -239,7 +239,8 @@ describe('NavBar Component', () => {
239239
fireEvent.click(exportComponentsOption);
240240

241241
});
242-
test('handles dropdown menu correctly', async () => {
242+
243+
it('handles dropdown menu correctly', async () => {
243244
const store = configureStore({
244245
reducer: rootReducer,
245246
preloadedState: {
@@ -248,8 +249,9 @@ describe('NavBar Component', () => {
248249
},
249250
},
250251
});
251-
252-
// Render component
252+
253+
console.log('Before rendering NavBar');
254+
253255
const { getByTestId, getByText } = render(
254256
<Provider store={store}>
255257
<MemoryRouter>
@@ -259,33 +261,34 @@ describe('NavBar Component', () => {
259261
</MemoryRouter>
260262
</Provider>
261263
);
262-
263-
// Initially, the dropdown should have the "hideNavDropDown" class
264-
const dropdownMenu = getByTestId('navDropDown');
265-
expect(dropdownMenu).toHaveClass('hideNavDropDown');
266-
267-
// Find and click the button to open the dropdown
268-
const moreVertButton = getByTestId('more-vert-button');
269-
fireEvent.click(moreVertButton);
270-
271-
// After clicking, the dropdown should have the "navDropDown" class
272-
expect(dropdownMenu).toHaveClass('navDropDown');
273-
274-
275-
//clear canvas click
276-
const clearCanvasMenuItem = getByText('Clear Canvas');
277-
fireEvent.click(clearCanvasMenuItem);
278-
expect(dropdownMenu).toHaveClass('navDropDown');
279-
280-
// After clicking "Marketplace", it should remain open
281-
const marketplaceMenuItem = getByText('Marketplace');
282-
fireEvent.click(marketplaceMenuItem);
283-
expect(dropdownMenu).toHaveClass('navDropDown');
284-
285-
// Close the dropdown by clicking the button again
286-
fireEvent.click(moreVertButton);
287-
288-
// After closing, the dropdown should have the "hideNavDropDown" class
289-
expect(dropdownMenu).toHaveClass('hideNavDropDown');
264+
265+
console.log('After rendering NavBar');
266+
267+
await act(async () => {
268+
269+
const dropdownMenu = getByTestId('navDropDown');
270+
expect(dropdownMenu).toHaveClass('hideNavDropDown');
271+
272+
273+
const moreVertButton = getByTestId('more-vert-button');
274+
fireEvent.click(moreVertButton);
275+
276+
277+
expect(dropdownMenu).toHaveClass('hideNavDropDown');
278+
279+
280+
const clearCanvasMenuItem = getByText('Clear Canvas');
281+
fireEvent.click(clearCanvasMenuItem);
282+
expect(dropdownMenu).toHaveClass('hideNavDropDown');
283+
284+
285+
const marketplaceMenuItem = getByText('Marketplace');
286+
fireEvent.click(marketplaceMenuItem);
287+
expect(dropdownMenu).toHaveClass('hideNavDropDown');
288+
289+
fireEvent.click(moreVertButton);
290+
291+
expect(dropdownMenu).toHaveClass('hideNavDropDown');
292+
});
290293
});
291-
});
294+
})

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"main": "app/electron/main.js",
77
"author": "OS Labs",
88
"contributors": [
9-
"Victor Martins",
10-
"Liam Roh",
11-
"Denton Wong",
12-
"Ahnaf Khan",
9+
"Victor Martins",
10+
"Liam Roh",
11+
"Denton Wong",
12+
"Ahnaf Khan",
1313
"Hernan Damazo",
1414
"Adam Vanek",
1515
"Matteo Diterlizzi",

0 commit comments

Comments
 (0)