You've already forked homehub
Release 1.4.0
This commit is contained in:
@@ -67,10 +67,31 @@ describe('src/main/containers/DashboardContainer', () => {
|
||||
|
||||
// Then
|
||||
expect(dashboard.exists()).toBe(true);
|
||||
expect(dashboard.prop('readOnly')).toBe(false);
|
||||
expect(dashboard.prop('layout')).toEqual(expectedLayout);
|
||||
});
|
||||
|
||||
it('configures and render a ServiceContainer for services', () => {
|
||||
it('configures and renders the dashboard as read-only', () => {
|
||||
// Given
|
||||
fakeSettings.READ_ONLY = true;
|
||||
|
||||
const component = mount(
|
||||
<DashboardsContext.Provider value={fakeDashboardsContext}>
|
||||
<DashboardContainer.ControlledDashboardContainer
|
||||
settings={fakeSettings}
|
||||
/>
|
||||
</DashboardsContext.Provider>
|
||||
);
|
||||
|
||||
// When
|
||||
const dashboard = component.find(Dashboard).at(0);
|
||||
|
||||
// Then
|
||||
expect(dashboard.exists()).toBe(true);
|
||||
expect(dashboard.prop('readOnly')).toBe(true);
|
||||
});
|
||||
|
||||
it('configures and renders a ServiceContainer for services', () => {
|
||||
// Given
|
||||
const component = mount(
|
||||
<DashboardsContext.Provider value={fakeDashboardsContext}>
|
||||
@@ -93,6 +114,27 @@ describe('src/main/containers/DashboardContainer', () => {
|
||||
expect(serviceContainer.prop('kind')).toEqual(
|
||||
fakeDashboardsContext.dashboards[0].services[0].kind
|
||||
);
|
||||
expect(serviceContainer.prop('readOnly')).toBe(false);
|
||||
});
|
||||
|
||||
it('configures and renders ServiceContainers as read-oniy', () => {
|
||||
// Given
|
||||
fakeSettings.READ_ONLY = true;
|
||||
|
||||
const component = mount(
|
||||
<DashboardsContext.Provider value={fakeDashboardsContext}>
|
||||
<DashboardContainer.ControlledDashboardContainer
|
||||
settings={fakeSettings}
|
||||
/>
|
||||
</DashboardsContext.Provider>
|
||||
);
|
||||
|
||||
// When
|
||||
const serviceContainers = component.find(ServiceContainer);
|
||||
const serviceContainer = serviceContainers.at(0);
|
||||
|
||||
// Then
|
||||
expect(serviceContainer.prop('readOnly')).toBe(true);
|
||||
});
|
||||
|
||||
it('configures and renders a DashboardItem for services', () => {
|
||||
|
||||
Reference in New Issue
Block a user