mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1. Make use of MUI styles and remove SCSS. 2. Use the new common components for buttons and tooltips, so that they are consistent. 3. UI design should be aligned with the query tool. 4. Remove tippyjs and Alertify dependencies.
33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
import jasmineEnzyme from 'jasmine-enzyme';
|
|
import React from 'react';
|
|
import {mount} from 'enzyme';
|
|
import '../../helper/enzyme.helper';
|
|
|
|
import ConnectionBar, {STATUS} from 'pgadmin.tools.erd/erd_tool/components/ConnectionBar';
|
|
import Theme from '../../../../pgadmin/static/js/Theme';
|
|
|
|
describe('ERD ConnectionBar', ()=>{
|
|
beforeEach(()=>{
|
|
jasmineEnzyme();
|
|
});
|
|
|
|
it('<ConnectionBar /> comp', ()=>{
|
|
const connBar = mount(<Theme><ConnectionBar status={STATUS.DISCONNECTED} title="test title"/></Theme>);
|
|
|
|
expect(connBar.find('DefaultButton[data-test="btn-conn-title"]').text()).toBe('test title');
|
|
|
|
connBar.setProps({
|
|
children: <ConnectionBar status={STATUS.CONNECTING} title="test title"/>
|
|
});
|
|
expect(connBar.find('DefaultButton[data-test="btn-conn-title"]').text()).toBe('(Obtaining connection...) test title');
|
|
|
|
connBar.setProps({
|
|
children: <ConnectionBar status={STATUS.CONNECTING} title="test title" bgcolor='#000' fgcolor='#fff'/>
|
|
});
|
|
const titleEle = connBar.find('DefaultButton[data-test="btn-conn-title"]');
|
|
|
|
expect(titleEle.prop('style').backgroundColor).toBe('#000');
|
|
expect(titleEle.prop('style').color).toBe('#fff');
|
|
});
|
|
});
|