mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: center the same layers
This commit is contained in:
1 parent
7a8df716da
commit
b19d6bf6e2
3 files changed
+55
-2
No files matched your search
@@ -125,3 +125,41 @@ describe('dag edges', () => {
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('dag layers', () => {
|
||||
it('two layer', () => {
|
||||
const data = [
|
||||
{
|
||||
_id: 'helloworld',
|
||||
requirements: [],
|
||||
},
|
||||
{
|
||||
_id: 'spell',
|
||||
requirements: ['helloworld'],
|
||||
},
|
||||
]
|
||||
|
||||
const dag = new DAG(data)
|
||||
expect(dag.getLayers()).toEqual([1, 1])
|
||||
})
|
||||
|
||||
it('branch layers', () => {
|
||||
const data = [
|
||||
{
|
||||
_id: 'helloworld',
|
||||
requirements: [],
|
||||
},
|
||||
{
|
||||
_id: 'spell',
|
||||
requirements: ['helloworld'],
|
||||
},
|
||||
{
|
||||
_id: 'discover',
|
||||
requirements: ['helloworld'],
|
||||
},
|
||||
]
|
||||
|
||||
const dag = new DAG(data)
|
||||
expect(dag.getLayers()).toEqual([1, 2])
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user