Skip to content

Commit 2e6cc50

Browse files
committed
refactor: make fixed prop true by default in CHeader and CFooter
1 parent f329bee commit 2e6cc50

File tree

5 files changed

+15
-18
lines changed

5 files changed

+15
-18
lines changed

src/components/footer/CFooter.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<component :is="tag" :class="classList">
3-
<slot>Footer</slot>
3+
<slot></slot>
44
</component>
55
</template>
66

@@ -12,7 +12,10 @@ export default {
1212
type: String,
1313
default: 'footer'
1414
},
15-
fixed: Boolean
15+
fixed: {
16+
type: Boolean,
17+
default: true
18+
}
1619
},
1720
computed: {
1821
classList () {

src/components/footer/tests/CFooter.spec.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@ import Component from '../CFooter'
33

44
const ComponentName = 'CFooter'
55
const wrapper = mount(Component)
6-
// /* eslint-disable no-console */
7-
// console.log("something")
6+
87

98
describe(`${ComponentName} .vue`, () => {
109
it('has a name', () => {
11-
expect(Component.name).toMatch(ComponentName)
10+
expect(Component.name).toBe(ComponentName)
1211
})
13-
// Inspect the raw component options
14-
// it('has isFixed method', () => {
15-
// expect(typeof Component.methods.isFixed).toBe('function')
16-
// })
1712
it('renders correctly', () => {
1813
expect(wrapper.element).toMatchSnapshot()
19-
expect(wrapper.element.textContent).toEqual('Footer')
20-
// expect(wrapper.classes()).toContain('app-footer')
2114
})
22-
});
15+
})

src/components/footer/tests/__snapshots__/CFooter.spec.js.snap

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
exports[`CFooter .vue renders correctly 1`] = `
44
<footer
5-
class="c-footer"
6-
>
7-
Footer
8-
</footer>
5+
class="c-footer c-footer-fixed"
6+
/>
97
`;

src/components/header/CHeader.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ export default {
1616
type: String,
1717
default: 'light'
1818
},
19-
fixed: Boolean,
19+
fixed: {
20+
type: Boolean,
21+
default: true
22+
},
2023
withSubheader: Boolean
2124
},
2225
computed: {

src/components/header/tests/__snapshots__/CHeader.spec.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
exports[`CHeader .vue renders correctly 1`] = `
44
<header
5-
class="c-header c-header-light"
5+
class="c-header c-header-light c-header-fixed"
66
/>
77
`;

0 commit comments

Comments
 (0)