diff options
Diffstat (limited to 'gui/test')
| -rw-r--r-- | gui/test/transition-rule.spec.ts | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/gui/test/transition-rule.spec.ts b/gui/test/transition-rule.spec.ts deleted file mode 100644 index 6896370d21..0000000000 --- a/gui/test/transition-rule.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { expect } from 'chai'; -import { it, describe } from 'mocha'; -import TransitionRule from '../src/renderer/lib/transition-rule'; - -describe('TransitionRule', () => { - const testTransition = { - forward: { name: 'forward', duration: 0.25 }, - backward: { name: 'backward', duration: 0.25 }, - }; - - it('should match wildcard rule', () => { - const rule = new TransitionRule(null, '/route', testTransition); - - expect(rule.match(null, '/route')).to.deep.equal({ - direction: 'forward', - descriptor: { name: 'forward', duration: 0.25 }, - }); - - expect(rule.match('/somewhere', '/route')).to.deep.equal({ - direction: 'forward', - descriptor: { name: 'forward', duration: 0.25 }, - }); - }); - - it('should match wildcard rule reversion', () => { - const rule = new TransitionRule(null, '/route', testTransition); - - expect(rule.match('/route', '/other')).to.deep.equal({ - direction: 'backward', - descriptor: { name: 'backward', duration: 0.25 }, - }); - }); - - it('should match exact rule', () => { - const rule = new TransitionRule('/route1', '/route2', testTransition); - - expect(rule.match('/other', '/route1')).to.be.null; - expect(rule.match('/other', '/route2')).to.be.null; - - expect(rule.match('/route1', '/route2')).to.deep.equal({ - direction: 'forward', - descriptor: { name: 'forward', duration: 0.25 }, - }); - }); - - it('should match exact rule reversion', () => { - const rule = new TransitionRule('/route1', '/route2', testTransition); - - expect(rule.match('/route1', '/other')).to.be.null; - expect(rule.match('/route2', '/other')).to.be.null; - - expect(rule.match('/route2', '/route1')).to.deep.equal({ - direction: 'backward', - descriptor: { name: 'backward', duration: 0.25 }, - }); - }); -}); |
