Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover committed Oct 23, 2019
1 parent 8c6686e commit f612fb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ const DASHBOARD_FEATURE: FeatureCatalogueEntry = {

describe('FeatureCatalogueRegistry', () => {
describe('setup', () => {
test('allows registry of new items', () => {
const setup = new FeatureCatalogueRegistry().setup();
setup.register(DASHBOARD_FEATURE);
});

test('throws when registering duplicate id', () => {
const setup = new FeatureCatalogueRegistry().setup();
setup.register(DASHBOARD_FEATURE);
Expand Down Expand Up @@ -75,7 +70,7 @@ describe('FeatureCatalogueRegistry', () => {
});

describe('title sorting', () => {
test('filters by title', () => {
test('sorts by title ascending', () => {
const service = new FeatureCatalogueRegistry();
const setup = service.setup();
setup.register({ id: '1', title: 'Orange' } as any);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,7 @@ export interface FeatureCatalogueEntry {
readonly showOnHomePage: boolean;
}

interface Registry<T> {
setup(...deps: any[]): { register(item: T): void };
start(...deps: any[]): { get(): readonly T[] };
}

export class FeatureCatalogueRegistry implements Registry<FeatureCatalogueEntry> {
export class FeatureCatalogueRegistry {
private readonly features = new Map<string, FeatureCatalogueEntry>();

public setup() {
Expand Down

0 comments on commit f612fb9

Please sign in to comment.