blob: 2875ea756e6dbe39a76d56cc477d4ca34e27f219 [file] [log] [blame]
/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {assert} from '@open-wc/testing';
import {RepoName} from '../../api/rest-api';
import '../../test/common-test-setup';
import {createRepoUrl, RepoDetailView} from './repo';
suite('repo view state tests', () => {
test('createRepoUrl', () => {
assert.equal(createRepoUrl({}), '/admin/repos/undefined');
assert.equal(
createRepoUrl({repo: 'asdf' as RepoName}),
'/admin/repos/asdf'
);
assert.equal(
createRepoUrl({
repo: 'asdf' as RepoName,
detail: RepoDetailView.ACCESS,
}),
'/admin/repos/asdf,access'
);
});
});