mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
Version number and SHA added to user menu (#8850)
* working! * sigh... linting. * more linting
This commit is contained in:
committed by
Maxime Beauchemin
parent
930353286f
commit
5780d9d53b
@@ -17,7 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import { Nav } from 'react-bootstrap';
|
||||
|
||||
import Menu from '../../../src/components/Menu/Menu';
|
||||
@@ -137,4 +137,26 @@ describe('Menu', () => {
|
||||
expect(loggedOutWrapper.find('i.fa-sign-in')).toHaveLength(1);
|
||||
expect(loggedOutWrapper.find('i.fa-user')).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('renders version number and SHA', () => {
|
||||
const overrideProps = {
|
||||
data: {
|
||||
...defaultProps.data,
|
||||
navbar_right: {
|
||||
...defaultProps.data.navbar_right,
|
||||
version_string: 'A1',
|
||||
version_sha: 'X',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const props = {
|
||||
...defaultProps,
|
||||
...overrideProps,
|
||||
};
|
||||
|
||||
const versionedWrapper = mount(<Menu {...props} />);
|
||||
|
||||
expect(versionedWrapper.find('.version-info div')).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user