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 @@
icon,
},
props: {
syncStatusUnavailable: {
type: Boolean,
required: false,
default: false,
},
selectiveSyncType: {
type: String,
required: false,
......@@ -105,6 +110,13 @@
class="node-detail-value"
>
<span
v-if="syncStatusUnavailable"
class="node-detail-value-bold"
>
{{ __('Unknown') }}
</span>
<span
v-else
v-tooltip
class="node-sync-settings inline"
data-placement="bottom"
......
......@@ -5,12 +5,14 @@ import mountComponent from 'spec/helpers/vue_mount_component_helper';
import { mockNodeDetails } from '../mock_data';
const createComponent = (
syncStatusUnavailable = false,
selectiveSyncType = mockNodeDetails.selectiveSyncType,
lastEvent = mockNodeDetails.lastEvent,
cursorLastEvent = mockNodeDetails.cursorLastEvent) => {
const Component = Vue.extend(geoNodeSyncSettingsComponent);
return mountComponent(Component, {
syncStatusUnavailable,
selectiveSyncType,
lastEvent,
cursorLastEvent,
......@@ -29,7 +31,7 @@ describe('GeoNodeSyncSettingsComponent', () => {
describe('eventTimestampEmpty', () => {
it('returns `true` if one of the event timestamp is empty', () => {
const vmEmptyTimestamp = createComponent(mockNodeDetails.namespaces, {
const vmEmptyTimestamp = createComponent(false, mockNodeDetails.namespaces, {
id: 0,
timeStamp: 0,
}, {
......@@ -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