Commit da4f7795 authored by Mike Greiling's avatar Mike Greiling

Merge branch '51712-prefer-jasmine-matcher' into 'master'

4. enable jasmine/prefer-jasmine-matcher

See merge request gitlab-org/gitlab-ce!22236
parents db85dbbf db4c1f66
...@@ -38,5 +38,4 @@ rules: ...@@ -38,5 +38,4 @@ rules:
# Temporarily disabled to facilitate an upgrade to eslint-plugin-jasmine # Temporarily disabled to facilitate an upgrade to eslint-plugin-jasmine
jasmine/new-line-before-expect: off jasmine/new-line-before-expect: off
jasmine/no-promise-without-done-fail: off jasmine/no-promise-without-done-fail: off
jasmine/prefer-jasmine-matcher: off
jasmine/prefer-toHaveBeenCalledWith: off jasmine/prefer-toHaveBeenCalledWith: off
...@@ -158,9 +158,9 @@ describe('getTimeframeWindowFrom', () => { ...@@ -158,9 +158,9 @@ describe('getTimeframeWindowFrom', () => {
const timeframe = datetimeUtility.getTimeframeWindowFrom(startDate, 5); const timeframe = datetimeUtility.getTimeframeWindowFrom(startDate, 5);
expect(timeframe.length).toBe(5); expect(timeframe.length).toBe(5);
timeframe.forEach((timeframeItem, index) => { timeframe.forEach((timeframeItem, index) => {
expect(timeframeItem.getFullYear() === mockTimeframe[index].getFullYear()).toBe(true); expect(timeframeItem.getFullYear()).toBe(mockTimeframe[index].getFullYear());
expect(timeframeItem.getMonth() === mockTimeframe[index].getMonth()).toBe(true); expect(timeframeItem.getMonth()).toBe(mockTimeframe[index].getMonth());
expect(timeframeItem.getDate() === mockTimeframe[index].getDate()).toBeTruthy(); expect(timeframeItem.getDate()).toBe(mockTimeframe[index].getDate());
}); });
}); });
}); });
......
...@@ -24,14 +24,14 @@ describe('DiffFile', () => { ...@@ -24,14 +24,14 @@ describe('DiffFile', () => {
expect(el.querySelectorAll('.diff-content.hidden').length).toEqual(0); expect(el.querySelectorAll('.diff-content.hidden').length).toEqual(0);
expect(el.querySelector('.js-file-title')).toBeDefined(); expect(el.querySelector('.js-file-title')).toBeDefined();
expect(el.querySelector('.file-title-name').innerText.indexOf(filePath) > -1).toEqual(true); expect(el.querySelector('.file-title-name').innerText.indexOf(filePath)).toBeGreaterThan(-1);
expect(el.querySelector('.js-syntax-highlight')).toBeDefined(); expect(el.querySelector('.js-syntax-highlight')).toBeDefined();
expect(vm.file.renderIt).toEqual(false); expect(vm.file.renderIt).toEqual(false);
vm.file.renderIt = true; vm.file.renderIt = true;
vm.$nextTick(() => { vm.$nextTick(() => {
expect(el.querySelectorAll('.line_content').length > 5).toEqual(true); expect(el.querySelectorAll('.line_content').length).toBeGreaterThan(5);
}); });
}); });
...@@ -98,9 +98,7 @@ describe('DiffFile', () => { ...@@ -98,9 +98,7 @@ describe('DiffFile', () => {
'This source diff could not be displayed because it is too large', 'This source diff could not be displayed because it is too large',
); );
expect(vm.$el.querySelector('.js-too-large-diff')).toBeDefined(); expect(vm.$el.querySelector('.js-too-large-diff')).toBeDefined();
expect(vm.$el.querySelector('.js-too-large-diff a').href.indexOf(BLOB_LINK) > -1).toEqual( expect(vm.$el.querySelector('.js-too-large-diff a').href.indexOf(BLOB_LINK)).toBeGreaterThan(-1);
true,
);
done(); done();
}); });
......
...@@ -94,7 +94,7 @@ describe('DiffLineGutterContent', () => { ...@@ -94,7 +94,7 @@ describe('DiffLineGutterContent', () => {
const component = createComponent({ lineNumber, lineCode }); const component = createComponent({ lineNumber, lineCode });
const link = component.$el.querySelector('a'); const link = component.$el.querySelector('a');
expect(link.href.indexOf(`#${lineCode}`) > -1).toEqual(true); expect(link.href.indexOf(`#${lineCode}`)).toBeGreaterThan(-1);
expect(link.dataset.linenumber).toEqual(lineNumber.toString()); expect(link.dataset.linenumber).toEqual(lineNumber.toString());
}); });
......
...@@ -27,7 +27,7 @@ describe('InlineDiffView', () => { ...@@ -27,7 +27,7 @@ describe('InlineDiffView', () => {
expect(el.querySelectorAll('tr.line_holder').length).toEqual(6); expect(el.querySelectorAll('tr.line_holder').length).toEqual(6);
expect(el.querySelectorAll('tr.line_holder.new').length).toEqual(2); expect(el.querySelectorAll('tr.line_holder.new').length).toEqual(2);
expect(el.querySelectorAll('tr.line_holder.match').length).toEqual(1); expect(el.querySelectorAll('tr.line_holder.match').length).toEqual(1);
expect(el.textContent.indexOf('Bad dates') > -1).toEqual(true); expect(el.textContent.indexOf('Bad dates')).toBeGreaterThan(-1);
}); });
it('should render discussions', done => { it('should render discussions', done => {
...@@ -37,7 +37,7 @@ describe('InlineDiffView', () => { ...@@ -37,7 +37,7 @@ describe('InlineDiffView', () => {
Vue.nextTick(() => { Vue.nextTick(() => {
expect(el.querySelectorAll('.notes_holder').length).toEqual(1); expect(el.querySelectorAll('.notes_holder').length).toEqual(1);
expect(el.querySelectorAll('.notes_holder .note-discussion li').length).toEqual(5); expect(el.querySelectorAll('.notes_holder .note-discussion li').length).toEqual(5);
expect(el.innerText.indexOf('comment 5') > -1).toEqual(true); expect(el.innerText.indexOf('comment 5')).toBeGreaterThan(-1);
component.$store.dispatch('setInitialNotes', []); component.$store.dispatch('setInitialNotes', []);
done(); done();
......
...@@ -237,7 +237,7 @@ describe('Dropdown Utils', () => { ...@@ -237,7 +237,7 @@ describe('Dropdown Utils', () => {
it('should not linear-gradient more than 4 colors', () => { it('should not linear-gradient more than 4 colors', () => {
const gradient = DropdownUtils.duplicateLabelColor(['#FFFFFF', '#000000', '#333333', '#DDDDDD', '#EEEEEE']); const gradient = DropdownUtils.duplicateLabelColor(['#FFFFFF', '#000000', '#333333', '#DDDDDD', '#EEEEEE']);
expect(gradient.indexOf('#EEEEEE') === -1).toEqual(true); expect(gradient.indexOf('#EEEEEE')).toBe(-1);
}); });
}); });
......
...@@ -19,7 +19,7 @@ describe('Filtered Search Token Keys', () => { ...@@ -19,7 +19,7 @@ describe('Filtered Search Token Keys', () => {
describe('get', () => { describe('get', () => {
it('should return tokenKeys', () => { it('should return tokenKeys', () => {
expect(new FilteredSearchTokenKeys().get() !== null).toBe(true); expect(new FilteredSearchTokenKeys().get()).not.toBeNull();
}); });
it('should return tokenKeys as an array', () => { it('should return tokenKeys as an array', () => {
...@@ -40,7 +40,7 @@ describe('Filtered Search Token Keys', () => { ...@@ -40,7 +40,7 @@ describe('Filtered Search Token Keys', () => {
describe('getConditions', () => { describe('getConditions', () => {
it('should return conditions', () => { it('should return conditions', () => {
expect(new FilteredSearchTokenKeys().getConditions() !== null).toBe(true); expect(new FilteredSearchTokenKeys().getConditions()).not.toBeNull();
}); });
it('should return conditions as an array', () => { it('should return conditions as an array', () => {
...@@ -51,7 +51,7 @@ describe('Filtered Search Token Keys', () => { ...@@ -51,7 +51,7 @@ describe('Filtered Search Token Keys', () => {
describe('searchByKey', () => { describe('searchByKey', () => {
it('should return null when key not found', () => { it('should return null when key not found', () => {
const tokenKey = new FilteredSearchTokenKeys(tokenKeys).searchByKey('notakey'); const tokenKey = new FilteredSearchTokenKeys(tokenKeys).searchByKey('notakey');
expect(tokenKey === null).toBe(true); expect(tokenKey).toBeNull();
}); });
it('should return tokenKey when found by key', () => { it('should return tokenKey when found by key', () => {
...@@ -63,7 +63,7 @@ describe('Filtered Search Token Keys', () => { ...@@ -63,7 +63,7 @@ describe('Filtered Search Token Keys', () => {
describe('searchBySymbol', () => { describe('searchBySymbol', () => {
it('should return null when symbol not found', () => { it('should return null when symbol not found', () => {
const tokenKey = new FilteredSearchTokenKeys(tokenKeys).searchBySymbol('notasymbol'); const tokenKey = new FilteredSearchTokenKeys(tokenKeys).searchBySymbol('notasymbol');
expect(tokenKey === null).toBe(true); expect(tokenKey).toBeNull();
}); });
it('should return tokenKey when found by symbol', () => { it('should return tokenKey when found by symbol', () => {
...@@ -75,7 +75,7 @@ describe('Filtered Search Token Keys', () => { ...@@ -75,7 +75,7 @@ describe('Filtered Search Token Keys', () => {
describe('searchByKeyParam', () => { describe('searchByKeyParam', () => {
it('should return null when key param not found', () => { it('should return null when key param not found', () => {
const tokenKey = new FilteredSearchTokenKeys(tokenKeys).searchByKeyParam('notakeyparam'); const tokenKey = new FilteredSearchTokenKeys(tokenKeys).searchByKeyParam('notakeyparam');
expect(tokenKey === null).toBe(true); expect(tokenKey).toBeNull();
}); });
it('should return tokenKey when found by key param', () => { it('should return tokenKey when found by key param', () => {
...@@ -92,7 +92,7 @@ describe('Filtered Search Token Keys', () => { ...@@ -92,7 +92,7 @@ describe('Filtered Search Token Keys', () => {
describe('searchByConditionUrl', () => { describe('searchByConditionUrl', () => {
it('should return null when condition url not found', () => { it('should return null when condition url not found', () => {
const condition = new FilteredSearchTokenKeys([], [], conditions).searchByConditionUrl(null); const condition = new FilteredSearchTokenKeys([], [], conditions).searchByConditionUrl(null);
expect(condition === null).toBe(true); expect(condition).toBeNull();
}); });
it('should return condition when found by url', () => { it('should return condition when found by url', () => {
...@@ -106,7 +106,7 @@ describe('Filtered Search Token Keys', () => { ...@@ -106,7 +106,7 @@ describe('Filtered Search Token Keys', () => {
it('should return null when condition tokenKey and value not found', () => { it('should return null when condition tokenKey and value not found', () => {
const condition = new FilteredSearchTokenKeys([], [], conditions) const condition = new FilteredSearchTokenKeys([], [], conditions)
.searchByConditionKeyValue(null, null); .searchByConditionKeyValue(null, null);
expect(condition === null).toBe(true); expect(condition).toBeNull();
}); });
it('should return condition when found by tokenKey and value', () => { it('should return condition when found by tokenKey and value', () => {
......
...@@ -168,9 +168,9 @@ describe('glDropdown', function describeDropdown() { ...@@ -168,9 +168,9 @@ describe('glDropdown', function describeDropdown() {
it('should show loading indicator while search results are being fetched by backend', () => { it('should show loading indicator while search results are being fetched by backend', () => {
const dropdownMenu = document.querySelector('.dropdown-menu'); const dropdownMenu = document.querySelector('.dropdown-menu');
expect(dropdownMenu.className.indexOf('is-loading') !== -1).toEqual(true); expect(dropdownMenu.className.indexOf('is-loading')).not.toBe(-1);
remoteCallback(); remoteCallback();
expect(dropdownMenu.className.indexOf('is-loading') !== -1).toEqual(false); expect(dropdownMenu.className.indexOf('is-loading')).toBe(-1);
}); });
it('should not focus search input while remote task is not complete', () => { it('should not focus search input while remote task is not complete', () => {
......
...@@ -45,7 +45,7 @@ describe('GroupItemComponent', () => { ...@@ -45,7 +45,7 @@ describe('GroupItemComponent', () => {
expect(Object.keys(rowClass).length).toBe(classes.length); expect(Object.keys(rowClass).length).toBe(classes.length);
Object.keys(rowClass).forEach((className) => { Object.keys(rowClass).forEach((className) => {
expect(classes.indexOf(className) > -1).toBeTruthy(); expect(classes.indexOf(className)).toBeGreaterThan(-1);
}); });
}); });
}); });
......
...@@ -53,7 +53,7 @@ describe('GroupsComponent', () => { ...@@ -53,7 +53,7 @@ describe('GroupsComponent', () => {
expect(vm.$el.querySelector('.groups-list-tree-container')).toBeDefined(); expect(vm.$el.querySelector('.groups-list-tree-container')).toBeDefined();
expect(vm.$el.querySelector('.group-list-tree')).toBeDefined(); expect(vm.$el.querySelector('.group-list-tree')).toBeDefined();
expect(vm.$el.querySelector('.gl-pagination')).toBeDefined(); expect(vm.$el.querySelector('.gl-pagination')).toBeDefined();
expect(vm.$el.querySelectorAll('.has-no-search-results').length === 0).toBeTruthy(); expect(vm.$el.querySelectorAll('.has-no-search-results').length).toBe(0);
done(); done();
}); });
}); });
......
...@@ -107,7 +107,7 @@ describe('ItemStatsComponent', () => { ...@@ -107,7 +107,7 @@ describe('ItemStatsComponent', () => {
const visibilityIconEl = vm.$el.querySelector('.item-visibility'); const visibilityIconEl = vm.$el.querySelector('.item-visibility');
expect(visibilityIconEl).not.toBe(null); expect(visibilityIconEl).not.toBe(null);
expect(visibilityIconEl.dataset.originalTitle).toBe(vm.visibilityTooltip); expect(visibilityIconEl.dataset.originalTitle).toBe(vm.visibilityTooltip);
expect(visibilityIconEl.querySelectorAll('svg').length > 0).toBeTruthy(); expect(visibilityIconEl.querySelectorAll('svg').length).toBeGreaterThan(0);
vm.$destroy(); vm.$destroy();
}); });
...@@ -120,10 +120,10 @@ describe('ItemStatsComponent', () => { ...@@ -120,10 +120,10 @@ describe('ItemStatsComponent', () => {
const vm = createComponent(item); const vm = createComponent(item);
const projectStarIconEl = vm.$el.querySelector('.project-stars'); const projectStarIconEl = vm.$el.querySelector('.project-stars');
expect(projectStarIconEl).not.toBe(null); expect(projectStarIconEl).not.toBeNull();
expect(projectStarIconEl.querySelectorAll('svg').length > 0).toBeTruthy(); expect(projectStarIconEl.querySelectorAll('svg').length).toBeGreaterThan(0);
expect(projectStarIconEl.querySelectorAll('.stat-value').length > 0).toBeTruthy(); expect(projectStarIconEl.querySelectorAll('.stat-value').length).toBeGreaterThan(0);
expect(vm.$el.querySelectorAll('.last-updated').length > 0).toBeTruthy(); expect(vm.$el.querySelectorAll('.last-updated').length).toBeGreaterThan(0);
vm.$destroy(); vm.$destroy();
}); });
......
...@@ -57,8 +57,8 @@ describe('ItemStatsValueComponent', () => { ...@@ -57,8 +57,8 @@ describe('ItemStatsValueComponent', () => {
it('renders component element correctly', () => { it('renders component element correctly', () => {
expect(vm.$el.classList.contains('number-subgroups')).toBeTruthy(); expect(vm.$el.classList.contains('number-subgroups')).toBeTruthy();
expect(vm.$el.querySelectorAll('svg').length > 0).toBeTruthy(); expect(vm.$el.querySelectorAll('svg').length).toBeGreaterThan(0);
expect(vm.$el.querySelectorAll('.stat-value').length > 0).toBeTruthy(); expect(vm.$el.querySelectorAll('.stat-value').length).toBeGreaterThan(0);
}); });
it('renders element tooltip correctly', () => { it('renders element tooltip correctly', () => {
......
...@@ -29,7 +29,7 @@ describe('ProjectsStore', () => { ...@@ -29,7 +29,7 @@ describe('ProjectsStore', () => {
store.setGroups(mockGroups); store.setGroups(mockGroups);
expect(store.state.groups.length).toBe(mockGroups.length); expect(store.state.groups.length).toBe(mockGroups.length);
expect(store.formatGroupItem).toHaveBeenCalledWith(jasmine.any(Object)); expect(store.formatGroupItem).toHaveBeenCalledWith(jasmine.any(Object));
expect(Object.keys(store.state.groups[0]).indexOf('fullName') > -1).toBeTruthy(); expect(Object.keys(store.state.groups[0]).indexOf('fullName')).toBeGreaterThan(-1);
}); });
}); });
...@@ -41,8 +41,8 @@ describe('ProjectsStore', () => { ...@@ -41,8 +41,8 @@ describe('ProjectsStore', () => {
store.setSearchedGroups(mockSearchedGroups); store.setSearchedGroups(mockSearchedGroups);
expect(store.state.groups.length).toBe(mockSearchedGroups.length); expect(store.state.groups.length).toBe(mockSearchedGroups.length);
expect(store.formatGroupItem).toHaveBeenCalledWith(jasmine.any(Object)); expect(store.formatGroupItem).toHaveBeenCalledWith(jasmine.any(Object));
expect(Object.keys(store.state.groups[0]).indexOf('fullName') > -1).toBeTruthy(); expect(Object.keys(store.state.groups[0]).indexOf('fullName')).toBeGreaterThan(-1);
expect(Object.keys(store.state.groups[0].children[0]).indexOf('fullName') > -1).toBeTruthy(); expect(Object.keys(store.state.groups[0].children[0]).indexOf('fullName')).toBeGreaterThan(-1);
}); });
}); });
...@@ -54,7 +54,7 @@ describe('ProjectsStore', () => { ...@@ -54,7 +54,7 @@ describe('ProjectsStore', () => {
store.setGroupChildren(mockParentGroupItem, mockRawChildren); store.setGroupChildren(mockParentGroupItem, mockRawChildren);
expect(store.formatGroupItem).toHaveBeenCalledWith(jasmine.any(Object)); expect(store.formatGroupItem).toHaveBeenCalledWith(jasmine.any(Object));
expect(mockParentGroupItem.children.length).toBe(1); expect(mockParentGroupItem.children.length).toBe(1);
expect(Object.keys(mockParentGroupItem.children[0]).indexOf('fullName') > -1).toBeTruthy(); expect(Object.keys(mockParentGroupItem.children[0]).indexOf('fullName')).toBeGreaterThan(-1);
expect(mockParentGroupItem.isOpen).toBeTruthy(); expect(mockParentGroupItem.isOpen).toBeTruthy();
expect(mockParentGroupItem.isChildrenLoading).toBeFalsy(); expect(mockParentGroupItem.isChildrenLoading).toBeFalsy();
}); });
...@@ -81,14 +81,14 @@ describe('ProjectsStore', () => { ...@@ -81,14 +81,14 @@ describe('ProjectsStore', () => {
store = new GroupsStore(); store = new GroupsStore();
updatedGroupItem = store.formatGroupItem(mockRawChildren[0]); updatedGroupItem = store.formatGroupItem(mockRawChildren[0]);
expect(Object.keys(updatedGroupItem).indexOf('fullName') > -1).toBeTruthy(); expect(Object.keys(updatedGroupItem).indexOf('fullName')).toBeGreaterThan(-1);
expect(updatedGroupItem.childrenCount).toBe(mockRawChildren[0].children_count); expect(updatedGroupItem.childrenCount).toBe(mockRawChildren[0].children_count);
expect(updatedGroupItem.isChildrenLoading).toBe(false); expect(updatedGroupItem.isChildrenLoading).toBe(false);
expect(updatedGroupItem.isBeingRemoved).toBe(false); expect(updatedGroupItem.isBeingRemoved).toBe(false);
store = new GroupsStore(true); store = new GroupsStore(true);
updatedGroupItem = store.formatGroupItem(mockRawChildren[0]); updatedGroupItem = store.formatGroupItem(mockRawChildren[0]);
expect(Object.keys(updatedGroupItem).indexOf('fullName') > -1).toBeTruthy(); expect(Object.keys(updatedGroupItem).indexOf('fullName')).toBeGreaterThan(-1);
expect(updatedGroupItem.childrenCount).toBe(mockRawChildren[0].subgroup_count); expect(updatedGroupItem.childrenCount).toBe(mockRawChildren[0].subgroup_count);
}); });
}); });
......
...@@ -32,7 +32,7 @@ describe('commentIndicatorHelper', () => { ...@@ -32,7 +32,7 @@ describe('commentIndicatorHelper', () => {
expect(svgEl).toBeDefined(); expect(svgEl).toBeDefined();
const svgLink = svgEl.querySelector('use').getAttribute('xlink:href'); const svgLink = svgEl.querySelector('use').getAttribute('xlink:href');
expect(svgLink.indexOf('image-comment-dark') !== -1).toEqual(true); expect(svgLink.indexOf('image-comment-dark')).not.toBe(-1);
}); });
}); });
}); });
......
...@@ -43,7 +43,7 @@ describe('common_utils', () => { ...@@ -43,7 +43,7 @@ describe('common_utils', () => {
it('should remove the question mark from the search params', () => { it('should remove the question mark from the search params', () => {
const paramsArray = commonUtils.urlParamsToArray('?test=thing'); const paramsArray = commonUtils.urlParamsToArray('?test=thing');
expect(paramsArray[0][0] !== '?').toBe(true); expect(paramsArray[0][0]).not.toBe('?');
}); });
}); });
......
...@@ -538,7 +538,7 @@ import timeoutPromise from './helpers/set_timeout_promise_helper'; ...@@ -538,7 +538,7 @@ import timeoutPromise from './helpers/set_timeout_promise_helper';
mockNotesPost(); mockNotesPost();
$('.js-comment-button').click(); $('.js-comment-button').click();
expect($notesContainer.find('.note.being-posted').length > 0).toEqual(true); expect($notesContainer.find('.note.being-posted').length).toBeGreaterThan(0);
}); });
it('should remove placeholder note when new comment is done posting', done => { it('should remove placeholder note when new comment is done posting', done => {
...@@ -582,7 +582,7 @@ import timeoutPromise from './helpers/set_timeout_promise_helper'; ...@@ -582,7 +582,7 @@ import timeoutPromise from './helpers/set_timeout_promise_helper';
$('.js-comment-button').click(); $('.js-comment-button').click();
setTimeout(() => { setTimeout(() => {
expect($notesContainer.find(`#note_${note.id}`).length > 0).toEqual(true); expect($notesContainer.find(`#note_${note.id}`).length).toBeGreaterThan(0);
done(); done();
}); });
...@@ -776,7 +776,7 @@ import timeoutPromise from './helpers/set_timeout_promise_helper'; ...@@ -776,7 +776,7 @@ import timeoutPromise from './helpers/set_timeout_promise_helper';
$form.find('textarea.js-note-text').val(sampleComment); $form.find('textarea.js-note-text').val(sampleComment);
const { formData, formContent, formAction } = this.notes.getFormData($form); const { formData, formContent, formAction } = this.notes.getFormData($form);
expect(formData.indexOf(sampleComment) > -1).toBe(true); expect(formData.indexOf(sampleComment)).toBeGreaterThan(-1);
expect(formContent).toEqual(sampleComment); expect(formContent).toEqual(sampleComment);
expect(formAction).toEqual($form.attr('action')); expect(formAction).toEqual($form.attr('action'));
}); });
......
...@@ -137,7 +137,7 @@ describe('MemoryUsage', () => { ...@@ -137,7 +137,7 @@ describe('MemoryUsage', () => {
} = vm; } = vm;
expect(hasMetrics).toBeTruthy(); expect(hasMetrics).toBeTruthy();
expect(memoryMetrics.length > 0).toBeTruthy(); expect(memoryMetrics.length).toBeGreaterThan(0);
expect(deploymentTime).toEqual(deployment_time); expect(deploymentTime).toEqual(deployment_time);
expect(memoryFrom).toEqual('9.13'); expect(memoryFrom).toEqual('9.13');
expect(memoryTo).toEqual('4.28'); expect(memoryTo).toEqual('4.28');
......
...@@ -52,8 +52,8 @@ describe('MemoryGraph', () => { ...@@ -52,8 +52,8 @@ describe('MemoryGraph', () => {
it('should show human readable median value based on provided median timestamp', () => { it('should show human readable median value based on provided median timestamp', () => {
vm.deploymentTime = mockMedian; vm.deploymentTime = mockMedian;
const formattedMedian = vm.getFormattedMedian; const formattedMedian = vm.getFormattedMedian;
expect(formattedMedian.indexOf('Deployed') > -1).toBeTruthy(); expect(formattedMedian.indexOf('Deployed')).toBeGreaterThan(-1);
expect(formattedMedian.indexOf('ago') > -1).toBeTruthy(); expect(formattedMedian.indexOf('ago')).toBeGreaterThan(-1);
}); });
}); });
}); });
......
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