-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move amplify js v6 to latest (#1135)
* feat: move amplify js v6 to latest * feat: add v6 integ tests and update v5 canary * fix: use corrent version syntax * fix: signIn v6 api e2e test template * fix: use ThemeProvider for v6 * chore: make old integ test use v5 * fix: pass in dependencies to integ test generator * fix: need v5 dependencies in package lock to install for integ tests * fix: put the env var in the correct position * fix: downgrade /datastore to ^4.0.0 * fix: downgrade /datastore to ^4.0.0 package lock * fix: use datastore v4 for windows integ setup --------- Co-authored-by: David Lopez <[email protected]>
- Loading branch information
1 parent
a7c9f73
commit 69ece2f
Showing
14 changed files
with
1,268 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/test-generator/e2e-test-templates-amplify-js-v6/.eslintrc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
rules: { | ||
'import/no-unresolved': 'off', | ||
'import/no-extraneous-dependencies': 'off', | ||
'import/extensions': 'off', | ||
}, | ||
}; |
23 changes: 23 additions & 0 deletions
23
packages/test-generator/e2e-test-templates-amplify-js-v6/cypress.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"). | ||
You may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const { defineConfig } = require('cypress'); | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
supportFile: false, | ||
}, | ||
}); |
3 changes: 3 additions & 0 deletions
3
packages/test-generator/e2e-test-templates-amplify-js-v6/cypress/.eslintrc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['plugin:cypress/recommended'], | ||
}; |
28 changes: 28 additions & 0 deletions
28
packages/test-generator/e2e-test-templates-amplify-js-v6/cypress/e2e/e2e-tests.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"). | ||
You may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
describe('e2e-tests', () => { | ||
before(() => { | ||
cy.visit('localhost:3000'); | ||
}); | ||
|
||
it('renders datastore collection', () => { | ||
// wait to log in | ||
// eslint-disable-next-line cypress/no-unnecessary-waiting | ||
cy.wait(4000); | ||
cy.get('#blogPosts').contains('Working on E2E Tests'); | ||
}); | ||
}); |
57 changes: 57 additions & 0 deletions
57
packages/test-generator/e2e-test-templates-amplify-js-v6/src/App.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"). | ||
You may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
import { Amplify } from 'aws-amplify'; | ||
import { signIn } from 'aws-amplify/auth'; | ||
import { DataStore, AuthModeStrategyType } from 'aws-amplify/datastore'; | ||
import '@aws-amplify/ui-react/styles.css'; | ||
import { ThemeProvider } from '@aws-amplify/ui-react'; | ||
import { useEffect, useRef, useState } from 'react'; | ||
import amplifyconfig from './amplifyconfiguration.json'; | ||
import { BlogPosts } from './ui-components'; | ||
|
||
Amplify.configure(amplifyconfig); | ||
DataStore.configure({ | ||
DataStore: { | ||
authModeStrategyType: AuthModeStrategyType.MULTI_AUTH, | ||
}, | ||
}); | ||
|
||
function App() { | ||
const [isLoggedIn, setIsLoggedIn] = useState(false); | ||
const initialized = useRef(false); | ||
|
||
useEffect(() => { | ||
if (initialized.current) { | ||
return; | ||
} | ||
initialized.current = true; | ||
signIn({ username: process.env.REACT_APP_USER_EMAIL, password: process.env.REACT_APP_USER_PASSWORD }).then(() => { | ||
setIsLoggedIn(true); | ||
}); | ||
}, []); | ||
|
||
if (isLoggedIn) { | ||
return ( | ||
<ThemeProvider> | ||
<BlogPosts id="blogPosts" /> | ||
</ThemeProvider> | ||
); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.