-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
6,323 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
3,124 changes: 3,124 additions & 0 deletions
3,124
packages/g6/__tests__/snapshots/behaviors/auto-adapt-label/disable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,124 changes: 3,124 additions & 0 deletions
3,124
packages/g6/__tests__/snapshots/behaviors/auto-adapt-label/padding-60.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
37 changes: 37 additions & 0 deletions
37
packages/g6/__tests__/unit/behaviors/auto-adapt-label.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { positionOf, type Graph } from '@/src'; | ||
import { behaviorAutoAdaptLabel } from '@@/demos'; | ||
import { createDemoGraph } from '@@/utils'; | ||
|
||
describe('behavior auto adapt label', () => { | ||
let graph: Graph; | ||
|
||
beforeAll(async () => { | ||
graph = await createDemoGraph(behaviorAutoAdaptLabel, { animation: false }); | ||
}); | ||
|
||
afterAll(() => { | ||
graph.destroy(); | ||
}); | ||
|
||
it('default', async () => { | ||
await expect(graph).toMatchSnapshot(__filename); | ||
}); | ||
|
||
it('disable', async () => { | ||
graph.updateBehavior({ key: 'auto-adapt-label', enable: false }); | ||
await expect(graph).toMatchSnapshot(__filename, 'disable'); | ||
}); | ||
|
||
it('update options', async () => { | ||
graph.updateBehavior({ key: 'auto-adapt-label', enable: true, padding: 60 }); | ||
await expect(graph).toMatchSnapshot(__filename, 'padding-60'); | ||
}); | ||
|
||
it('update sorter', async () => { | ||
graph.updateBehavior({ key: 'auto-adapt-label', padding: 0 }); | ||
const origin = positionOf(graph.getNodeData('Albanian')); | ||
graph.zoomTo(3, false, origin); | ||
await expect(graph).toMatchSnapshot(__filename, 'zoom-3'); | ||
graph.zoomTo(1, false, origin); | ||
}); | ||
}); |
24 changes: 0 additions & 24 deletions
24
packages/g6/__tests__/unit/behaviors/toggle-label-visibility.spec.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters