-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
propagate code editor settings to all editor surfaces (#3520)
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
- Loading branch information
1 parent
d70a316
commit 99240e9
Showing
10 changed files
with
112 additions
and
19 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
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
50 changes: 50 additions & 0 deletions
50
Composer/packages/ui-plugins/expressions/src/__tests__/ExpressionField.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,50 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import React from 'react'; | ||
import { render } from '@bfc/test-utils'; | ||
import assign from 'lodash/assign'; | ||
|
||
import { ExpressionField } from '../ExpressionField'; | ||
|
||
const defaultProps = { | ||
depth: 0, | ||
schema: {}, | ||
definitions: {}, | ||
uiOptions: {}, | ||
name: 'testName', | ||
id: 'testId', | ||
onChange: jest.fn(), | ||
onBlur: jest.fn(), | ||
onFocus: jest.fn(), | ||
}; | ||
|
||
function renderSubject(overrides = {}) { | ||
const props = assign({}, defaultProps, overrides); | ||
return render(<ExpressionField {...props} />); | ||
} | ||
|
||
describe('<ExpressionField />', () => { | ||
const schema = { | ||
$role: 'expression', | ||
oneOf: [ | ||
{ | ||
type: 'string', | ||
title: 'String Value', | ||
}, | ||
{ | ||
type: 'number', | ||
title: 'Number Value', | ||
}, | ||
{ | ||
type: 'string', | ||
title: 'Expression Value', | ||
}, | ||
], | ||
}; | ||
|
||
it('renders a dropdown with the types', () => { | ||
const { getByTestId } = renderSubject({ schema, label: 'test' }); | ||
expect(getByTestId('expression-type-dropdown-test')).toBeInTheDocument(); | ||
}); | ||
}); |