Skip to content

Commit abbd659

Browse files
committed
Remove test text
1 parent cc240c3 commit abbd659

File tree

7 files changed

+89
-113
lines changed

7 files changed

+89
-113
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ jobs:
4646
sudo apt-get install -qq libgles2-mesa-dev libxcb-cursor0 libxcb-icccm4 libxcb-keysyms1 libxcb-shape0 libxcb-xkb1 libxkbcommon-x11-0
4747
sudo apt-get install -qq libdbus-1-3 libxcb-image0 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
4848
QT_QPA_PLATFORM=xcb xvfb-run --auto-servernum npm run test-ci
49-
# QT_DEBUG_PLUGINS=1 QT_QPA_PLATFORM=xcb xvfb-run --auto-servernum node test/debug.js
5049
5150
- uses: actions/upload-artifact@v4
5251
if: matrix.os == 'ubuntu-22.04'

__screenshots__/ui.png

-1.99 KB
Loading

test/3d-qml.test.js

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,83 @@
1-
// 'use strict';
1+
'use strict';
22

33

4-
// const assert = require('node:assert').strict;
5-
// const { describe, it } = require('node:test');
4+
const assert = require('node:assert').strict;
5+
const { describe, it } = require('node:test');
66

7-
// const inited = require('./init')();
8-
// const { QmlOverlay, QmlMaterial, QmlOverlayMaterial, loop, window } = inited;
7+
const inited = require('./init')();
8+
const { QmlOverlay, QmlMaterial, QmlOverlayMaterial, loop, window } = inited;
99

10-
// const initResults = [
11-
// 'QmlOverlay', 'QmlMaterial', 'QmlOverlayMaterial',
12-
// 'Property', 'Method', 'View',
13-
// 'loop', 'release', 'textureFromId',
14-
// ];
10+
const initResults = [
11+
'QmlOverlay', 'QmlMaterial', 'QmlOverlayMaterial',
12+
'Property', 'Method', 'View',
13+
'loop', 'release', 'textureFromId',
14+
];
1515

16-
// const initedClasses = {
17-
// QmlOverlay: {
18-
// create() {
19-
// return new QmlOverlay({ file: `${__dirname}/test.qml` });
20-
// },
21-
// props: ['isVisible', 'isDisabled', 'material', 'mesh'],
22-
// },
23-
// QmlMaterial: {
24-
// create() {
25-
// return new QmlMaterial();
26-
// },
27-
// props: ['textureId'],
28-
// },
29-
// QmlOverlayMaterial: {
30-
// create() {
31-
// return new QmlOverlayMaterial();
32-
// },
33-
// props: ['textureId'],
34-
// },
35-
// };
16+
const initedClasses = {
17+
QmlOverlay: {
18+
create() {
19+
return new QmlOverlay({ file: `${__dirname}/test.qml` });
20+
},
21+
props: ['isVisible', 'isDisabled', 'material', 'mesh'],
22+
},
23+
QmlMaterial: {
24+
create() {
25+
return new QmlMaterial();
26+
},
27+
props: ['textureId'],
28+
},
29+
QmlOverlayMaterial: {
30+
create() {
31+
return new QmlOverlayMaterial();
32+
},
33+
props: ['textureId'],
34+
},
35+
};
3636

3737

38-
// const tested = describe('Qml 3D Inited', () => {
39-
// it('returns all init results', () => {
40-
// initResults.forEach(
41-
// (name) => assert.strictEqual(
42-
// typeof inited[name],
43-
// 'function',
44-
// `Init field "${name}" is missing.`,
45-
// ),
46-
// );
47-
// });
38+
const tested = describe('Qml 3D Inited', () => {
39+
it('returns all init results', () => {
40+
initResults.forEach(
41+
(name) => assert.strictEqual(
42+
typeof inited[name],
43+
'function',
44+
`Init field "${name}" is missing.`,
45+
),
46+
);
47+
});
4848

49-
// Object.keys(initedClasses).forEach((c) => {
50-
// it(`exports class "${c}"`, () => {
51-
// assert.strictEqual(typeof inited[c], 'function');
52-
// });
49+
Object.keys(initedClasses).forEach((c) => {
50+
it(`exports class "${c}"`, () => {
51+
assert.strictEqual(typeof inited[c], 'function');
52+
});
5353

54-
// const current = initedClasses[c];
55-
// const instance = current.create();
54+
const current = initedClasses[c];
55+
const instance = current.create();
5656

57-
// it(`is valid instance of ${c}`, () => {
58-
// assert.ok(
59-
// instance instanceof inited[c],
60-
// `Can't instantiate class "${c}".`,
61-
// );
62-
// });
57+
it(`is valid instance of ${c}`, () => {
58+
assert.ok(
59+
instance instanceof inited[c],
60+
`Can't instantiate class "${c}".`,
61+
);
62+
});
6363

64-
// it(`exposes properties of "${c}"`, () => {
65-
// current.props.forEach((prop) => {
66-
// assert.ok(
67-
// typeof instance[prop] !== 'undefined',
68-
// `Property "${c}.${prop}" not found.`,
69-
// );
70-
// });
71-
// });
72-
// });
73-
// });
64+
it(`exposes properties of "${c}"`, () => {
65+
current.props.forEach((prop) => {
66+
assert.ok(
67+
typeof instance[prop] !== 'undefined',
68+
`Property "${c}.${prop}" not found.`,
69+
);
70+
});
71+
});
72+
});
73+
});
7474

75-
// (async () => {
76-
// const stop = loop(() => {
75+
(async () => {
76+
const stop = loop(() => {
7777

78-
// });
79-
// await tested;
80-
// stop();
81-
// window.destroy();
82-
// setTimeout(() => undefined, 500);
83-
// })();
78+
});
79+
await tested;
80+
stop();
81+
window.destroy();
82+
setTimeout(() => undefined, 500);
83+
})();

test/OpenSans-Regular.ttf

-212 KB
Binary file not shown.

test/compare.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const three = require('three');
77
const { screenshot } = require('./screenshot');
88
const inited = require('./init')();
99
const { window, QmlOverlay, loop, doc, Image } = inited;
10-
// const { window, loop, QmlOverlay } = inited;
1110

1211
const renderer = new three.WebGLRenderer();
1312
renderer.setPixelRatio(window.devicePixelRatio);

test/debug.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/test.qml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ import QtQuick
33
Rectangle {
44
anchors.fill: parent
55

6-
color: 'yellow'
7-
8-
FontLoader {
9-
id: _regular
10-
source: "./OpenSans-Regular.ttf"
11-
}
6+
color: 'grey'
127

138
Item {
149
objectName: 'obj1'
@@ -25,11 +20,24 @@ Rectangle {
2520
cb.call('m2c', x);
2621
}
2722

28-
Text {
29-
text: 'Hello World!'
30-
font.family: _regular.name
31-
font.weight: Font.Normal
32-
font.pixelSize: 20
23+
Row {
24+
padding: 10
25+
spacing: 10
26+
Rectangle {
27+
width: 32
28+
height: 32
29+
color: 'red'
30+
}
31+
Rectangle {
32+
width: 32
33+
height: 32
34+
color: 'green'
35+
}
36+
Rectangle {
37+
width: 32
38+
height: 32
39+
color: 'blue'
40+
}
3341
}
3442
}
3543
}

0 commit comments

Comments
 (0)