Skip to content

Commit

Permalink
DEFAULT_MAX_SIZE, DEFAULT_MIN_SIZE
Browse files Browse the repository at this point in the history
  • Loading branch information
BipanKishore committed May 5, 2024
1 parent f9e29fc commit 95ba8eb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
29 changes: 16 additions & 13 deletions cypress/component-testing/resizable-api.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ import {
import {CustomResizerFirst} from '../components/custom-resizer'
import {Pane, ResizablePanes} from '../../src'
import {IGetState, IResizableApi} from '../../src/@types'
import {BUTTOM_FIRST, HIDDEN, TOP_FIRST, VISIBLE} from '../../src/constant'
import {
BUTTOM_FIRST, DEFAULT_MAX_SIZE, DEFAULT_MIN_SIZE,
HIDDEN, TOP_FIRST, VISIBLE
} from '../../src/constant'

describe('Storage api', () => {
const rCy = new RCy({
Expand Down Expand Up @@ -92,14 +95,14 @@ describe('Storage api', () => {
P1: {
size: 515,
visibility: true,
minSize: 0,
maxSize: Infinity
[DEFAULT_MIN_SIZE]: 0,
[DEFAULT_MAX_SIZE]: Infinity
},
P0: {
size: 515,
visibility: true,
minSize: 0,
maxSize: Infinity
[DEFAULT_MIN_SIZE]: 0,
[DEFAULT_MAX_SIZE]: Infinity
}
})
})
Expand All @@ -122,14 +125,14 @@ describe('Storage api', () => {
P1: {
size: 515,
visibility: true,
minSize: 0,
maxSize: Infinity
[DEFAULT_MIN_SIZE]: 0,
[DEFAULT_MAX_SIZE]: Infinity
},
P0: {
size: 515,
visibility: true,
minSize: 0,
maxSize: Infinity
[DEFAULT_MIN_SIZE]: 0,
[DEFAULT_MAX_SIZE]: Infinity
}
})
})
Expand All @@ -151,14 +154,14 @@ describe('Storage api', () => {
P1: {
size: 515,
visibility: true,
minSize: 0,
maxSize: Infinity
[DEFAULT_MIN_SIZE]: 0,
[DEFAULT_MAX_SIZE]: Infinity
},
P0: {
size: 515,
visibility: true,
minSize: 0,
maxSize: Infinity
[DEFAULT_MIN_SIZE]: 0,
[DEFAULT_MAX_SIZE]: Infinity
}
})
})
Expand Down
4 changes: 2 additions & 2 deletions src/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export const RESIZER = 'resizer'

export const VISIBILITY = 'visibility'
export const SIZE = 'size'
export const MIN_SIZE = 'minSize'
export const MAX_SIZE = 'maxSize'
export const DEFAULT_MIN_SIZE = 'defaultMinSize'
export const DEFAULT_MAX_SIZE = 'defaultMaxSize'

export const PLUS = '+'
export const MINUS = '-'
Expand Down
6 changes: 3 additions & 3 deletions src/context/resizable-panes-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {createContext} from 'react'
import {createMap, findById} from '../utils/util'
import {
DIRECTIONS,
MAX_SIZE,
MIN_SIZE,
DEFAULT_MAX_SIZE,
DEFAULT_MIN_SIZE,
RATIO,
SET_SIZE,
SIZE,
Expand Down Expand Up @@ -245,7 +245,7 @@ export const getResizableContext = (
}

const getState = () =>
createMap(panesList, SIZE, VISIBILITY, MIN_SIZE, MAX_SIZE)
createMap(panesList, SIZE, VISIBILITY, DEFAULT_MIN_SIZE, DEFAULT_MAX_SIZE)
const getVisibilities = () => getVisibilityState(panesList)

const setSize = (
Expand Down

0 comments on commit 95ba8eb

Please sign in to comment.