diff options
Diffstat (limited to 'spec/frontend/blob/components/blob_header_spec.js')
-rw-r--r-- | spec/frontend/blob/components/blob_header_spec.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/frontend/blob/components/blob_header_spec.js b/spec/frontend/blob/components/blob_header_spec.js index 922d6a0211b..e7b2ee74940 100644 --- a/spec/frontend/blob/components/blob_header_spec.js +++ b/spec/frontend/blob/components/blob_header_spec.js @@ -116,13 +116,22 @@ describe('Blob Header Default Actions', () => { }); }); + it.each([[{ showBlameToggle: true }], [{ showBlameToggle: false }]])( + 'passes the `showBlameToggle` prop to the viewer switcher', + (propsData) => { + createComponent({ propsData }); + + expect(findViewSwitcher().props('showBlameToggle')).toBe(propsData.showBlameToggle); + }, + ); + it('does not render viewer switcher if the blob has only the simple viewer', () => { createComponent({ blobProps: { richViewer: null, }, }); - expect(findViewSwitcher().exists()).toBe(false); + expect(findViewSwitcher().props('showViewerToggles')).toBe(false); }); it('does not render viewer switcher if a corresponding prop is passed', () => { |