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
chore: Cleaned up Vue code #2184
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@aws-amplify/ui-vue': patch | ||
--- | ||
|
||
Cleaned Vue code. Updated jest to latest. Added in JSX. Updated how editor displays interface in .vue files. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import { mount } from '@vue/test-utils'; | ||
import { Authenticator } from '../dist'; | ||
import crypto from 'crypto'; | ||
|
||
// This is needed for jest to get crypto module needed by nanoid | ||
Object.defineProperty(global.self, 'crypto', { | ||
value: { | ||
getRandomValues: (arr: Array<unknown>) => crypto.randomBytes(arr.length), | ||
}, | ||
}); | ||
import Authenticator from '../src/components/authenticator.vue'; | ||
import { components } from '../global-spec'; | ||
import { render } from '@testing-library/vue'; | ||
|
||
describe('Authenticator', () => { | ||
it('Authenticator Exists', () => { | ||
const wrapper = mount(Authenticator); | ||
const wrapper = render(Authenticator, { | ||
global: { | ||
components, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To get vue to see all the components we have to add them in here. Since we are using |
||
}, | ||
}); | ||
|
||
expect(wrapper).toBeTruthy(); | ||
}); | ||
|
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,21 @@ | ||
import BaseWrapper from './src/components/primitives/base-wrapper.vue'; | ||
import BaseFooter from './src/components/primitives/base-footer.vue'; | ||
import BaseForm from './src/components/primitives/base-form.vue'; | ||
import BaseAlert from './src/components/primitives/base-alert.vue'; | ||
import BaseTwoTabItem from './src/components/primitives/base-two-tab-item.vue'; | ||
import BaseTwoTabs from './src/components/primitives/base-two-tabs.vue'; | ||
import BaseFieldSet from './src/components/primitives/base-field-set.vue'; | ||
import BaseHeading from './src/components/primitives/base-heading.vue'; | ||
import AmplifyButton from './src/components/primitives/amplify-button.vue'; | ||
|
||
export const components = { | ||
BaseWrapper, | ||
BaseFooter, | ||
BaseForm, | ||
AmplifyButton, | ||
BaseTwoTabItem, | ||
BaseTwoTabs, | ||
BaseAlert, | ||
BaseFieldSet, | ||
BaseHeading, | ||
}; |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
module.exports = { | ||
testEnvironment: 'jsdom', | ||
verbose: true, | ||
moduleFileExtensions: ['js', 'ts', 'json', 'vue'], | ||
moduleFileExtensions: ['js', 'ts', 'json', 'vue', 'tsx'], | ||
modulePathIgnorePatterns: ['<rootDir>/dist/'], | ||
transform: { | ||
'^.+\\.ts$': 'ts-jest', | ||
'^.+\\.(ts)$': 'ts-jest', | ||
'^.+\\.(js|jsx)$': 'babel-jest', | ||
'^.+\\.vue$': 'vue-jest', | ||
'^.+\\.vue$': '@vue/vue3-jest', | ||
}, | ||
}; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to need to pin jest, because of an issue with different jest versions breaking different tests being run on our frameworks. However, our tests no longer need this.
And I won't be able to use the latest version of the vue3-jest library unless we update to jest 27.