Skip to content

Commit f5932fa

Browse files
fix(cra-template): fix test to be successful (#497)
1 parent b1900cb commit f5932fa

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

packages/cra-template/template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@ui5/webcomponents": "1.0.0-rc.7",
55
"@ui5/webcomponents-fiori": "1.0.0-rc.7",
66
"@ui5/webcomponents-icons": "1.0.0-rc.7",
7-
"@ui5/webcomponents-react": "^0.9.0",
7+
"@ui5/webcomponents-react": "^0.9.4",
88
"@testing-library/react": "^9.3.2",
99
"@testing-library/jest-dom": "^4.2.4",
1010
"@testing-library/user-event": "^7.1.2",

packages/cra-template/template/src/App.js

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
import { ThemeProvider } from '@ui5/webcomponents-react/lib/ThemeProvider';
1+
import {
2+
FlexBox,
3+
FlexBoxAlignItems,
4+
FlexBoxDirection,
5+
FlexBoxJustifyContent,
6+
Link,
7+
LinkDesign,
8+
ShellBar,
9+
ThemeProvider
10+
} from '@ui5/webcomponents-react';
211
import React from 'react';
312
import './App.css';
4-
import logo from './logo.svg';
513

614
function App() {
715
return (
816
<ThemeProvider>
9-
<div className="App">
10-
<header className="App-header">
11-
<img src={logo} className="App-logo" alt="logo" />
12-
<p>
13-
Edit <code>src/App.js</code> and save to reload.
14-
</p>
15-
<a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
16-
Learn React
17-
</a>
18-
</header>
19-
</div>
17+
<ShellBar primaryTitle="UI5 Web Components for React Template" />
18+
<FlexBox
19+
style={{ width: '100%', height: '100vh' }}
20+
direction={FlexBoxDirection.Column}
21+
justifyContent={FlexBoxJustifyContent.Center}
22+
alignItems={FlexBoxAlignItems.Center}
23+
>
24+
<Link href="https://sap.github.io/ui5-webcomponents-react/" target="_blank" design={LinkDesign.Emphasized}>
25+
Getting Started with UI5 Web Component for React
26+
</Link>
27+
</FlexBox>
2028
</ThemeProvider>
2129
);
2230
}

packages/cra-template/template/src/App.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import App from './App';
44

55
test('renders learn react link', () => {
66
const { getByText } = render(<App />);
7-
const linkElement = getByText(/learn react/i);
7+
const linkElement = getByText(/Getting Started with UI5 Web Component for React/i);
88
expect(linkElement).toBeInTheDocument();
99
});

0 commit comments

Comments
 (0)