Skip to content
Open
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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"styled-components": "^4.3.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.1.1",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"jest-enzyme": "^6.0.2",
Expand Down
5 changes: 0 additions & 5 deletions src/Components/MicrofrontendAsComponent.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

const MicrofrontendAsComponent = () => (
<div data-testid="microfrontend-as-component">
Microfrontend as a Component
</div>
);

export default MicrofrontendAsComponent;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import MicrofrontendAsComponent from '../';
import { cleanup, render, screen } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';

// to make sure everything is clean after each test
afterAll(cleanup);

it('it checks if the content matches', () => {
render(<MicrofrontendAsComponent />);
const element = screen.getByTestId('microfrontend-as-component');
expect(element).toHaveTextContent('Microfrontend as a Component');
});
2 changes: 2 additions & 0 deletions src/Components/MicrofrontendAsComponent/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import MicrofrontendAsComponent from './MicrofrontendAsComponent';
export default MicrofrontendAsComponent;
5 changes: 0 additions & 5 deletions src/Components/MicrofrontendAsRoute.js

This file was deleted.

7 changes: 7 additions & 0 deletions src/Components/MicrofrontendAsRoute/MicrofrontendAsRoute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

const MicrofrontendAsRoute = () => (
<div data-testid="microfrontend-as-route">Microfrontend as a Route</div>
);

export default MicrofrontendAsRoute;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import MicrofrontendAsRoute from '../';
import { render, screen, cleanup } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';

// to make sure everything is clean after each test
afterAll(cleanup);

it('it checks if the content matches', () => {
render(<MicrofrontendAsRoute />);
const element = screen.getByTestId('microfrontend-as-route');
expect(element).toHaveTextContent('Microfrontend as a Route');
});
2 changes: 2 additions & 0 deletions src/Components/MicrofrontendAsRoute/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import MicrofrontendAsRoute from './MicrofrontendAsRoute';
export default MicrofrontendAsRoute;
Loading