You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui/packages/consul-ui/tests/unit/helpers/token/is-anonymous-test.js

19 lines
658 B

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { isAnonymous } from 'consul-ui/helpers/token/is-anonymous';
import { module, test } from 'qunit';
module('Unit | Helper | token/is-anonymous', function () {
test('it returns true if the token is the anonymous token', function (assert) {
const actual = isAnonymous([{ AccessorID: '00000000-0000-0000-0000-000000000002' }]);
assert.ok(actual);
});
test("it returns false if the token isn't the anonymous token", function (assert) {
const actual = isAnonymous([{ AccessorID: '00000000-0000-0000-0000-000000000000' }]);
assert.notOk(actual);
});
});