Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
more reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
moribellamy committed May 17, 2020
1 parent bffca7b commit f3f83ed
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// Webpack uses MiniCssExtractPlugin when it sees this.
import './scss/app.scss';

import { grayTabby } from './app/ui';
import { graytabby } from './app/ui';
import { PAGE_LOAD } from './lib/globals';

grayTabby().then(
graytabby().then(
() => {
PAGE_LOAD.get()
.pub()
Expand Down
2 changes: 1 addition & 1 deletion src/app/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ declare global {
/**
* The main entry point for GrayTabby.
*/
export async function grayTabby(): Promise<void> {
export async function graytabby(): Promise<void> {
DOCUMENT.get().title = 'GrayTabby';
await bindOptions();
const groupsNode = <HTMLDivElement>DOCUMENT.get().querySelector('#groups');
Expand Down
5 changes: 3 additions & 2 deletions tests/archive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { archivePlan } from '../src/bg/archive';
import { Broker, BrokerConsumer } from '../src/lib/brokers';
import { ARCHIVAL, DOCUMENT } from '../src/lib/globals';
import { dateFromKey, INDEX_V2_KEY } from '../src/app/tabs';
import { assertElement, initGrayTabby, testTab, stubGlobals, unstubGlobals } from './utils';
import { assertElement, testTab, stubGlobals, unstubGlobals } from './utils';
import { BrowserTab } from '../src/lib/types';
import { graytabby } from '../src/app/ui';

describe('archive operation', function() {
beforeEach(async function() {
Expand All @@ -25,7 +26,7 @@ describe('archive operation', function() {
consumer = func;
};
ARCHIVAL.set(archival);
await initGrayTabby();
await graytabby();
assertElement('#groups > div', DOCUMENT.get(), 0);

consumer([testTab({ url: 'http://example.com' })], {}, () => null);
Expand Down
5 changes: 3 additions & 2 deletions tests/grayTabby.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { initGrayTabby, stubGlobals, unstubGlobals } from './utils';
import { stubGlobals, unstubGlobals } from './utils';
import { bindArchivalHandlers } from '../src/bg/archive';
import { graytabby } from '../src/app/ui';

describe('graytabby', function() {
beforeEach(async function() {
Expand All @@ -11,7 +12,7 @@ describe('graytabby', function() {
});

it('frontend should attach to dom without throwing', async () => {
await initGrayTabby();
await graytabby();
});

it('backend should register handlers without throwing', async () => {
Expand Down
10 changes: 1 addition & 9 deletions tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai';
import { JSDOM } from 'jsdom';
import * as mockBrowser from 'sinon-chrome';
import { INDEX_V1_KEY, INDEX_V2_KEY } from '../src/app/tabs';
import { grayTabby } from '../src/app/ui';
import { graytabby } from '../src/app/ui';
import { BROWSER, DOCUMENT } from '../src/lib/globals';
import { OPTIONS_KEY } from '../src/lib/options';
import { BrowserTab } from '../src/lib/types';
Expand All @@ -22,14 +22,6 @@ export function unstubGlobals(): void {
DOCUMENT.set(null);
}

export async function initGrayTabby(): Promise<void> {
try {
return await grayTabby();
} catch (err) {
expect.fail('Uncaught error: ' + err);
}
}

export function testTab(args: Partial<BrowserTab>): BrowserTab {
return {
index: 1,
Expand Down

0 comments on commit f3f83ed

Please sign in to comment.