Commit b1b4ee1c authored by Simon Knox's avatar Simon Knox

Merge branch '324314-client-side-solution-for-empty-viewer' into 'master'

Blob refactor: Create empty viewer

See merge request gitlab-org/gitlab!65438
parents 5661410e b6ef9d14
<template>
<div class="nothing-here-block">{{ __('Empty file') }}</div>
</template>
export const loadViewer = (type) => {
switch (type) {
case 'empty':
// TODO (follow-up): import the empty viewer
return null; // () => import(/* webpackChunkName: 'blob_empty_viewer' */ './empty_viewer.vue');
return () => import(/* webpackChunkName: 'blob_empty_viewer' */ './empty_viewer.vue');
case 'text':
// TODO (follow-up): import the text viewer
return null; // () => import(/* webpackChunkName: 'blob_text_viewer' */ './text_viewer.vue');
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Empty Viewer matches the snapshot 1`] = `
<div
class="nothing-here-block"
>
Empty file
</div>
`;
import { shallowMount } from '@vue/test-utils';
import EmptyViewer from '~/repository/components/blob_viewers/empty_viewer.vue';
describe('Empty Viewer', () => {
let wrapper;
beforeEach(() => {
wrapper = shallowMount(EmptyViewer);
});
it('matches the snapshot', () => {
expect(wrapper.element).toMatchSnapshot();
});
});
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