-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from Agoric/main
Deploy main to production
- Loading branch information
Showing
18 changed files
with
271 additions
and
227 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,6 @@ typings/ | |
bundle-*.js | ||
/.vagrant | ||
.DS_Store | ||
.vscode/ | ||
.idea/ | ||
|
||
/packages.png | ||
|
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 @@ | ||
{ | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
74 changes: 74 additions & 0 deletions
74
wallet/src/components/tests/ConnectionSettingsDialog.test.tsx
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,74 @@ | ||
import { mount } from 'enzyme'; | ||
import ConnectionSettingsDialog from '../ConnectionSettingsDialog'; | ||
import { | ||
DEFAULT_CONNECTION_CONFIGS, | ||
KnownNetworkConfigUrls, | ||
} from '../../util/connections'; | ||
import { Select, TextField, ThemeProvider, createTheme } from '@mui/material'; | ||
import { act } from '@testing-library/react'; | ||
|
||
jest.mock('lodash-es/isEqual', () => () => true); | ||
|
||
const appTheme = createTheme({ | ||
palette: { | ||
// @ts-expect-error not in Palette | ||
cancel: { | ||
main: '#595959', | ||
}, | ||
}, | ||
}); | ||
|
||
const MOCK_LOCALHOST = 'http://foobar:440'; | ||
|
||
const withApplicationContext = | ||
(Component, _) => | ||
({ ...props }) => { | ||
return ( | ||
<ThemeProvider theme={appTheme}> | ||
<Component {...props} /> | ||
</ThemeProvider> | ||
); | ||
}; | ||
|
||
jest.mock('../../contexts/Application', () => { | ||
return { withApplicationContext }; | ||
}); | ||
|
||
describe('Connection setting dialog', () => { | ||
const { location } = window; | ||
|
||
beforeAll(() => { | ||
// @ts-expect-error mocking window.location | ||
delete window.location; | ||
|
||
// @ts-expect-error mocking window.location | ||
window.location = { origin: MOCK_LOCALHOST }; | ||
}); | ||
|
||
afterAll(() => { | ||
window.location = location; | ||
}); | ||
|
||
test('displays the dapp', () => { | ||
const component = mount( | ||
<ConnectionSettingsDialog | ||
allConnectionConfigs={DEFAULT_CONNECTION_CONFIGS} | ||
connectionConfig={{ href: KnownNetworkConfigUrls.main }} | ||
open | ||
/>, | ||
); | ||
|
||
const networkSelect = component.find(Select).first(); | ||
act(() => | ||
networkSelect.props().onChange({ target: { value: 'localhost' } }), | ||
); | ||
component.update(); | ||
|
||
const textField = component.find(TextField).first(); | ||
const inputField = textField.find('input').first(); | ||
|
||
expect(inputField.prop('value')).toEqual( | ||
`${MOCK_LOCALHOST}/wallet/network-config`, | ||
); | ||
}); | ||
}); |
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
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
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.