Commit 511738f0 authored by Kushal Pandya's avatar Kushal Pandya

Render `Unknown` for sync settings when `syncStatusUnavailable` is true

parent 1397e92b
...@@ -14,6 +14,11 @@ ...@@ -14,6 +14,11 @@
icon, icon,
}, },
props: { props: {
syncStatusUnavailable: {
type: Boolean,
required: false,
default: false,
},
selectiveSyncType: { selectiveSyncType: {
type: String, type: String,
required: false, required: false,
...@@ -105,6 +110,13 @@ ...@@ -105,6 +110,13 @@
class="node-detail-value" class="node-detail-value"
> >
<span <span
v-if="syncStatusUnavailable"
class="node-detail-value-bold"
>
{{ __('Unknown') }}
</span>
<span
v-else
v-tooltip v-tooltip
class="node-sync-settings inline" class="node-sync-settings inline"
data-placement="bottom" data-placement="bottom"
......
...@@ -5,12 +5,14 @@ import mountComponent from 'spec/helpers/vue_mount_component_helper'; ...@@ -5,12 +5,14 @@ import mountComponent from 'spec/helpers/vue_mount_component_helper';
import { mockNodeDetails } from '../mock_data'; import { mockNodeDetails } from '../mock_data';
const createComponent = ( const createComponent = (
syncStatusUnavailable = false,
selectiveSyncType = mockNodeDetails.selectiveSyncType, selectiveSyncType = mockNodeDetails.selectiveSyncType,
lastEvent = mockNodeDetails.lastEvent, lastEvent = mockNodeDetails.lastEvent,
cursorLastEvent = mockNodeDetails.cursorLastEvent) => { cursorLastEvent = mockNodeDetails.cursorLastEvent) => {
const Component = Vue.extend(geoNodeSyncSettingsComponent); const Component = Vue.extend(geoNodeSyncSettingsComponent);
return mountComponent(Component, { return mountComponent(Component, {
syncStatusUnavailable,
selectiveSyncType, selectiveSyncType,
lastEvent, lastEvent,
cursorLastEvent, cursorLastEvent,
...@@ -29,7 +31,7 @@ describe('GeoNodeSyncSettingsComponent', () => { ...@@ -29,7 +31,7 @@ describe('GeoNodeSyncSettingsComponent', () => {
describe('eventTimestampEmpty', () => { describe('eventTimestampEmpty', () => {
it('returns `true` if one of the event timestamp is empty', () => { it('returns `true` if one of the event timestamp is empty', () => {
const vmEmptyTimestamp = createComponent(mockNodeDetails.namespaces, { const vmEmptyTimestamp = createComponent(false, mockNodeDetails.namespaces, {
id: 0, id: 0,
timeStamp: 0, timeStamp: 0,
}, { }, {
...@@ -87,4 +89,12 @@ describe('GeoNodeSyncSettingsComponent', () => { ...@@ -87,4 +89,12 @@ describe('GeoNodeSyncSettingsComponent', () => {
}); });
}); });
}); });
describe('template', () => {
it('renders `Unknown` when `syncStatusUnavailable` prop is true', () => {
const vmSyncUnavailable = createComponent(true);
expect(vmSyncUnavailable.$el.innerText.trim()).toBe('Unknown');
vmSyncUnavailable.$destroy();
});
});
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment