Skip to content

Commit 436078a

Browse files
committed
Fix simple-select tests after rotation change for issue #15
1 parent f03463a commit 436078a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/tools/simple-select.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ describe('SimpleSelectTool tests', () => {
1919

2020
const VIEWBOX_WIDTH = 800;
2121
const VIEWBOX_HEIGHT = 600;
22+
const IDENTITY_MATRIX = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };
2223

2324
/* The editor image's <svg> element. */
2425
let fakeImageEl = {
@@ -42,6 +43,9 @@ describe('SimpleSelectTool tests', () => {
4243
getBBox() {
4344
return { x: 10, y: 20, width: 100, height: 50 };
4445
},
46+
getCTM() {
47+
return IDENTITY_MATRIX;
48+
}
4549
} as unknown as Element;
4650

4751
/* The EditorHost fake. */
@@ -96,4 +100,6 @@ describe('SimpleSelectTool tests', () => {
96100
const selectorBox = overlayEl.querySelector('#selectorBox');
97101
expect(Number(selectorBox.getAttribute('stroke-width'))).equals(expectedStrokeWidth);
98102
});
103+
104+
// TODO: Write a test for rotated selector overlay elements.
99105
});

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"include": [
3-
"src/**/*",
3+
"src/**/*.ts",
44
],
55
"exclude": [
6-
"src/**/*.spec.ts",
6+
"src/**/*.test.ts",
77
],
88
"compilerOptions": {
99
"lib": [

0 commit comments

Comments
 (0)