diff options
Diffstat (limited to 'spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js')
-rw-r--r-- | spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js b/spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js index b906e44a4f7..d730bfcde24 100644 --- a/spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js +++ b/spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js @@ -32,6 +32,10 @@ describe('Registry Breadcrumb', () => { { name: 'baz', meta: { nameGenerator } }, ]; + const state = { + imageDetails: { foo: 'bar' }, + }; + const findDivider = () => wrapper.find('.js-divider'); const findRootRoute = () => wrapper.find({ ref: 'rootRouteLink' }); const findChildRoute = () => wrapper.find({ ref: 'childRouteLink' }); @@ -52,6 +56,9 @@ describe('Registry Breadcrumb', () => { routes, }, }, + $store: { + state, + }, }, }); }; @@ -80,7 +87,7 @@ describe('Registry Breadcrumb', () => { }); it('the link text is calculated by nameGenerator', () => { - expect(nameGenerator).toHaveBeenCalledWith(routes[0]); + expect(nameGenerator).toHaveBeenCalledWith(state); expect(nameGenerator).toHaveBeenCalledTimes(1); }); }); @@ -104,7 +111,7 @@ describe('Registry Breadcrumb', () => { }); it('the link text is calculated by nameGenerator', () => { - expect(nameGenerator).toHaveBeenCalledWith(routes[1]); + expect(nameGenerator).toHaveBeenCalledWith(state); expect(nameGenerator).toHaveBeenCalledTimes(2); }); }); |