Commit 092c8d09 authored by Miguel Rincon's avatar Miguel Rincon

Merge branch '301143-add-missing-inherit-attrs-false' into 'master'

Add missing inheritAttrs: false

See merge request gitlab-org/gitlab!62170
parents cf8774d0 07b08ec2
......@@ -10,6 +10,7 @@ export default {
TopNavMenuItem,
VuexModuleProvider,
},
inheritAttrs: false,
props: {
frequentItemsVuexModule: {
type: String,
......
......@@ -23,13 +23,14 @@ const TEST_OTHER_PROPS = {
describe('~/nav/components/top_nav_container_view.vue', () => {
let wrapper;
const createComponent = (props = {}) => {
const createComponent = (props = {}, options = {}) => {
wrapper = shallowMount(TopNavContainerView, {
propsData: {
...DEFAULT_PROPS,
...TEST_OTHER_PROPS,
...props,
},
...options,
});
};
......@@ -44,6 +45,7 @@ describe('~/nav/components/top_nav_container_view.vue', () => {
return {
vuexModule: parent.props('vuexModule'),
props: parent.findComponent(FrequentItemsApp).props(),
attributes: parent.findComponent(FrequentItemsApp).attributes(),
};
};
......@@ -67,14 +69,23 @@ describe('~/nav/components/top_nav_container_view.vue', () => {
);
describe('default', () => {
const EXTRA_ATTRS = { 'data-test-attribute': 'foo' };
beforeEach(() => {
createComponent();
createComponent({}, { attrs: EXTRA_ATTRS });
});
it('does not inherit extra attrs', () => {
expect(wrapper.attributes()).toEqual({
class: expect.any(String),
});
});
it('renders frequent items app', () => {
expect(findFrequentItemsApp()).toEqual({
vuexModule: DEFAULT_PROPS.frequentItemsVuexModule,
props: TEST_OTHER_PROPS,
attributes: expect.objectContaining(EXTRA_ATTRS),
});
});
......
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