Debian Codegraph @

pkg/base1/test-info.ts

raw
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 import cockpit from "cockpit";
3 import QUnit from "qunit-tests";
4
5 QUnit.test("cockpit info", async assert => {
6 await cockpit.init();
7
8 assert.propContains(cockpit.info.channels, { fsread1: [], fsinfo: [] });
9
10 // We can't really assert the value of any particular thing here, since the
11 // tests get run in a wide range of environments, but we can at least make
12 // sure everything has the expected type.
13 assert.equal(typeof cockpit.info.os_release.NAME, 'string');
14
15 assert.equal(typeof cockpit.info.user.uid, 'number');
16 assert.equal(typeof cockpit.info.user.gid, 'number');
17 assert.equal(typeof cockpit.info.user.name, 'string');
18 assert.equal(typeof cockpit.info.user.group, 'string');
19 assert.equal(cockpit.info.user.group, cockpit.info.user.groups[0]);
20
21 assert.equal(typeof cockpit.info.ws.version, 'string');
22 });
23
24 QUnit.start();