Skip to content

Commit

Permalink
fix(fab): resolve test and ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJim committed Apr 23, 2023
1 parent 5b759aa commit cd35639
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
33 changes: 16 additions & 17 deletions src/fab/__test__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,31 @@
exports[`fab > slots > : icon 1`] = `
<button
aria-disabled="false"
class="t-button t-button--size-middle t-button--base t-button--primary t-button--round t-fab"
class="t-button t-button--size-large t-button--base t-button--primary t-button--circle t-fab"
role="button"
style="right: 16px; bottom: 32px;"
type="button"
>
<!---->
<svg
class="t-icon t-icon-app"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M11.25 1.75a3 3 0 100 6 3 3 0 000-6zm-2 3a2 2 0 114 0 2 2 0 01-4 0zM2 3a1 1 0 011-1h3.5a1 1 0 011 1v3.5a1 1 0 01-1 1H3a1 1 0 01-1-1V3zm1 0v3.5h3.5V3H3zM2 9.5a1 1 0 011-1h3.5a1 1 0 011 1V13a1 1 0 01-1 1H3a1 1 0 01-1-1V9.5zm1 0V13h3.5V9.5H3zM8.5 9.5a1 1 0 011-1H13a1 1 0 011 1V13a1 1 0 01-1 1H9.5a1 1 0 01-1-1V9.5zm1 3.5H13V9.5H9.5V13z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
<span
class="t-button__content"
>
<svg
class="t-icon t-icon-app"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M11.25 1.75a3 3 0 100 6 3 3 0 000-6zm-2 3a2 2 0 114 0 2 2 0 01-4 0zM2 3a1 1 0 011-1h3.5a1 1 0 011 1v3.5a1 1 0 01-1 1H3a1 1 0 01-1-1V3zm1 0v3.5h3.5V3H3zM2 9.5a1 1 0 011-1h3.5a1 1 0 011 1V13a1 1 0 01-1 1H3a1 1 0 01-1-1V9.5zm1 0V13h3.5V9.5H3zM8.5 9.5a1 1 0 011-1H13a1 1 0 011 1V13a1 1 0 01-1 1H9.5a1 1 0 01-1-1V9.5zm1 3.5H13V9.5H9.5V13z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
<!--v-if-->
</span>
<!---->
Expand Down
2 changes: 1 addition & 1 deletion src/fab/__test__/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('fab', () => {
const wrapper = mount(Fab, {
props: { text },
});
const textContainer = wrapper.find('.t-fab__text');
const textContainer = wrapper.find('.t-button__content');
expect(textContainer.text()).toBe(text);
});

Expand Down
4 changes: 2 additions & 2 deletions src/fab/fab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { computed, defineComponent, getCurrentInstance } from 'vue';
import { renderTNode, useEmitEvent } from '../shared';
import props from './props';
import config from '../config';
import TButton from '../button';
import TButton, { ButtonProps } from '../button';
const { prefix } = config;
const name = `${prefix}-fab`;
Expand All @@ -36,7 +36,7 @@ export default defineComponent({
const classes = computed(() => ({
[`${name}`]: true,
}));
const btnProps = computed(() => ({ shape: props.text ? 'round' : 'circle', ...props.buttonProps }));
const btnProps = computed<ButtonProps>(() => ({ shape: props.text ? 'round' : 'circle', ...props.buttonProps }));
const onClick = (e: MouseEvent) => emitEvent('click', { e });
Expand Down

0 comments on commit cd35639

Please sign in to comment.