From e1dac618a8b8929f601c7ec8aca3842c5ebf9d03 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 13 Apr 2020 20:37:36 +0900 Subject: Use plugin:prettier/recommended --- test/shared/settings/Key.test.ts | 120 +++++++++++++++++++++++---------------- 1 file changed, 72 insertions(+), 48 deletions(-) (limited to 'test/shared/settings/Key.test.ts') diff --git a/test/shared/settings/Key.test.ts b/test/shared/settings/Key.test.ts index b8538f8..47af1d9 100644 --- a/test/shared/settings/Key.test.ts +++ b/test/shared/settings/Key.test.ts @@ -1,74 +1,74 @@ -import { expect } from 'chai' -import Key from '../../../src/shared/settings/Key'; +import { expect } from "chai"; +import Key from "../../../src/shared/settings/Key"; describe("Key", () => { - describe('fromMapKey', () => { - it('return for X', () => { - const key = Key.fromMapKey('x'); - expect(key.key).to.equal('x'); + describe("fromMapKey", () => { + it("return for X", () => { + const key = Key.fromMapKey("x"); + expect(key.key).to.equal("x"); expect(key.shift).to.be.false; expect(key.ctrl).to.be.false; expect(key.alt).to.be.false; expect(key.meta).to.be.false; }); - it('return for Shift+X', () => { - const key = Key.fromMapKey('X'); - expect(key.key).to.equal('X'); + it("return for Shift+X", () => { + const key = Key.fromMapKey("X"); + expect(key.key).to.equal("X"); expect(key.shift).to.be.true; expect(key.ctrl).to.be.false; expect(key.alt).to.be.false; expect(key.meta).to.be.false; }); - it('return for Ctrl+X', () => { - const key = Key.fromMapKey(''); - expect(key.key).to.equal('x'); + it("return for Ctrl+X", () => { + const key = Key.fromMapKey(""); + expect(key.key).to.equal("x"); expect(key.shift).to.be.false; expect(key.ctrl).to.be.true; expect(key.alt).to.be.false; expect(key.meta).to.be.false; }); - it('returns for Ctrl+Meta+X', () => { - const key = Key.fromMapKey(''); - expect(key.key).to.equal('x'); + it("returns for Ctrl+Meta+X", () => { + const key = Key.fromMapKey(""); + expect(key.key).to.equal("x"); expect(key.shift).to.be.false; expect(key.ctrl).to.be.true; expect(key.alt).to.be.false; expect(key.meta).to.be.true; }); - it('returns for Ctrl+Shift+x', () => { - const key = Key.fromMapKey(''); - expect(key.key).to.equal('X'); + it("returns for Ctrl+Shift+x", () => { + const key = Key.fromMapKey(""); + expect(key.key).to.equal("X"); expect(key.shift).to.be.true; expect(key.ctrl).to.be.true; expect(key.alt).to.be.false; expect(key.meta).to.be.false; }); - it('returns for Shift+Esc', () => { - const key = Key.fromMapKey(''); - expect(key.key).to.equal('Esc'); + it("returns for Shift+Esc", () => { + const key = Key.fromMapKey(""); + expect(key.key).to.equal("Esc"); expect(key.shift).to.be.true; expect(key.ctrl).to.be.false; expect(key.alt).to.be.false; expect(key.meta).to.be.false; }); - it('returns for Ctrl+Esc', () => { - const key = Key.fromMapKey(''); - expect(key.key).to.equal('Esc'); + it("returns for Ctrl+Esc", () => { + const key = Key.fromMapKey(""); + expect(key.key).to.equal("Esc"); expect(key.shift).to.be.false; expect(key.ctrl).to.be.true; expect(key.alt).to.be.false; expect(key.meta).to.be.false; }); - it('returns for Ctrl+Esc', () => { - const key = Key.fromMapKey(''); - expect(key.key).to.equal('Space'); + it("returns for Ctrl+Esc", () => { + const key = Key.fromMapKey(""); + expect(key.key).to.equal("Space"); expect(key.shift).to.be.false; expect(key.ctrl).to.be.true; expect(key.alt).to.be.false; @@ -76,30 +76,54 @@ describe("Key", () => { }); }); - describe('idDigit', () => { - it('returns true if the key is a digit', () => { - expect(new Key({ key: '0' }).isDigit()).to.be.true; - expect(new Key({ key: '9' }).isDigit()).to.be.true; - expect(new Key({ key: '9', alt: true }).isDigit()).to.be.false; + describe("idDigit", () => { + it("returns true if the key is a digit", () => { + expect(new Key({ key: "0" }).isDigit()).to.be.true; + expect(new Key({ key: "9" }).isDigit()).to.be.true; + expect(new Key({ key: "9", alt: true }).isDigit()).to.be.false; - expect(new Key({ key: 'a' }).isDigit()).to.be.false; - expect(new Key({ key: '0' }).isDigit()).to.be.false; - }) + expect(new Key({ key: "a" }).isDigit()).to.be.false; + expect(new Key({ key: "0" }).isDigit()).to.be.false; + }); }); - describe('equals', () => { - it('returns true if the keys are equivalent', () => { - expect(new Key({ - key: 'x', shift: false, ctrl: true, alt: false, meta: false, - }).equals(new Key({ - key: 'x', shift: false, ctrl: true, alt: false, meta: false, - }))).to.be.true; + describe("equals", () => { + it("returns true if the keys are equivalent", () => { + expect( + new Key({ + key: "x", + shift: false, + ctrl: true, + alt: false, + meta: false, + }).equals( + new Key({ + key: "x", + shift: false, + ctrl: true, + alt: false, + meta: false, + }) + ) + ).to.be.true; - expect(new Key({ - key: 'x', shift: false, ctrl: false, alt: false, meta: false, - }).equals(new Key({ - key: 'X', shift: true, ctrl: false, alt: false, meta: false, - }))).to.be.false; - }) + expect( + new Key({ + key: "x", + shift: false, + ctrl: false, + alt: false, + meta: false, + }).equals( + new Key({ + key: "X", + shift: true, + ctrl: false, + alt: false, + meta: false, + }) + ) + ).to.be.false; + }); }); }); -- cgit v1.2.3