Skip to content

Commit

Permalink
tests: Add case for global overrides that negate filesystems with mode
Browse files Browse the repository at this point in the history
Issue #577
  • Loading branch information
tchx84 committed Apr 10, 2024
1 parent 85e19ca commit 1564a06
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/src/testModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,27 @@ describe('Model', function() {
update();
});

it('handles global overrides that negate filesystems with mode', function(done) {
GLib.setenv('FLATPAK_USER_DIR', _tmp, true);

permissionsDefault.appId = _filesystemWithMode;
expect(permissionsDefault.filesystems_other).toEqual('host:ro;xdg-documents:ro;home:ro');

permissionsDefault.appId = 'global';
expect(permissionsDefault.filesystems_other).toEqual('');
permissionsDefault.set_property('filesystems_other', '!host');

GLib.timeout_add(GLib.PRIORITY_HIGH, delay + 1, () => {
permissionsDefault.appId = _filesystemWithMode;
expect(permissionsDefault.filesystems_other).toEqual('xdg-documents:ro;home:ro');

done();
return GLib.SOURCE_REMOVE;
});

update();
});

it('handles malformed overrides', function() {
spyOn(permissionsDefault, 'emit');

Expand Down

0 comments on commit 1564a06

Please sign in to comment.