Skip to content

Commit

Permalink
Rename composable
Browse files Browse the repository at this point in the history
to simpler name that's also consistent
with the other grid composable's name.
  • Loading branch information
MisRob committed Oct 4, 2024
1 parent b66ac07 commit e40d29d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/cards/KCardGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import { watch, ref, provide } from '@vue/composition-api';
import { LAYOUT_1_1_1, LAYOUT_1_2_2, LAYOUT_1_2_3 } from './gridBaseLayouts';
import useResponsiveGridLayout from './useResponsiveGridLayout';
import useGridLayout from './useGridLayout';
import useGridLoading from './useGridLoading';
import SkeletonCard from './SkeletonCard';
Expand All @@ -59,7 +59,7 @@
SkeletonCard,
},
setup(props) {
const { currentBreakpointConfig, windowBreakpoint } = useResponsiveGridLayout(props);
const { currentBreakpointConfig, windowBreakpoint } = useGridLayout(props);
const {
finishedMounting,
isLoading,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* import { ref } from '@vue/composition-api'; */

/* import useKResponsiveWindow from '../../composables/useKResponsiveWindow'; */
import useResponsiveGridLayout from '../useResponsiveGridLayout';
import useGridLayout from '../useGridLayout';

/* jest.mock('../../composables/useKResponsiveWindow');
*/
Expand All @@ -12,15 +12,15 @@ jest.mock('../../composables/useKResponsiveWindow', () => ({
})),
}));

describe('useResponsiveGridLayout', () => {
describe('useGridLayout', () => {
/* beforeAll(() => {
useKResponsiveWindow.mockImplementation(() => ({
windowBreakpoint: ref(7),
}));
});
*/
it('returns a correct base layout config for the current breakpoint', () => {
const { currentBreakpointConfig } = useResponsiveGridLayout({ layout: '1-2-3' });
const { currentBreakpointConfig } = useGridLayout({ layout: '1-2-3' });
expect(currentBreakpointConfig.value).toEqual({
cardsPerRow: 3,
columnGap: '30px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getBreakpointConfig } from './utils';
* Observes window size and returns the grid layout
* configuration object for the current breakpoint.
*/
export default function useResponsiveGridLayout(props) {
export default function useGridLayout(props) {
const currentBreakpointConfig = ref({});

const { windowBreakpoint } = useKResponsiveWindow();
Expand Down

0 comments on commit e40d29d

Please sign in to comment.