Propmt when a api key can not be use + house keeping (#173)

* chore: remove old files

* chore: change JS tests to TS, delete dummy tests

* chore: bump manifests version
This commit is contained in:
Juan Sebastian velez Posada
2023-02-22 08:11:16 -05:00
committed by GitHub
parent fe49f50b65
commit 35543489e5
46 changed files with 132 additions and 1611 deletions

View File

@@ -1,17 +0,0 @@
jest.dontMock('../../assets/js/components/Alert.jsx');
describe('Alert', function () {
var React, Alert, TestUtils, Component;
beforeEach(function () {
// Setup our tools
React = require('react/addons');
Alert = require('../../assets/js/components/Alert.jsx');
TestUtils = React.addons.TestUtils;
// Create the React component here using TestUtils and store into Component
});
it('should work', function () {
expect(2 + 2).toEqual(4);
});
});

View File

@@ -1,17 +0,0 @@
jest.dontMock('../../assets/js/components/MainList.jsx');
describe('MainList', function () {
var React, MainList, TestUtils, Component;
beforeEach(function () {
// Setup our tools
React = require('react/addons');
MainList = require('../../assets/js/components/MainList.jsx');
TestUtils = React.addons.TestUtils;
// Create the React component here using TestUtils and store into Component
});
it('should work', function () {
expect(2 + 2).toEqual(4);
});
});

View File

@@ -1,17 +0,0 @@
jest.dontMock('../../assets/js/components/Navbar.jsx');
describe('Navbar', function () {
var React, Navbar, TestUtils, Component;
beforeEach(function () {
// Setup our tools
React = require('react/addons');
Navbar = require('../../assets/js/components/Navbar.jsx');
TestUtils = React.addons.TestUtils;
// Create the React component here using TestUtils and store into Component
});
it('should work', function () {
expect(2 + 2).toEqual(4);
});
});

View File

@@ -1,17 +0,0 @@
jest.dontMock('../../assets/js/components/Options.jsx');
describe('Options', function () {
var React, Options, TestUtils, Component;
beforeEach(function () {
// Setup our tools
React = require('react/addons');
Options = require('../../assets/js/components/Options.jsx');
TestUtils = React.addons.TestUtils;
// Create the React component here using TestUtils and store into Component
});
it('should work', function () {
expect(2 + 2).toEqual(4);
});
});

View File

@@ -1,17 +0,0 @@
jest.dontMock('../../assets/js/components/SitesList.jsx');
describe('SitesList', function () {
var React, SitesList, TestUtils, Component;
beforeEach(function () {
// Setup our tools
React = require('react/addons');
SitesList = require('../../assets/js/components/SitesList.jsx');
TestUtils = React.addons.TestUtils;
// Create the React component here using TestUtils and store into Component
});
it('should work', function () {
expect(2 + 2).toEqual(4);
});
});

View File

@@ -1,17 +0,0 @@
jest.dontMock('../../assets/js/components/Wakatime.jsx');
describe('Wakatime', function () {
var React, Wakatime, TestUtils, Component;
beforeEach(function () {
// Setup our tools
React = require('react/addons');
Wakatime = require('../../assets/js/components/Wakatime.jsx');
TestUtils = React.addons.TestUtils;
// Create the React component here using TestUtils and store into Component
});
it('should work', function () {
expect(2 + 2).toEqual(4);
});
});

View File

@@ -1,10 +0,0 @@
var chai = require('chai');
var expect = chai.expect;
var changeExtensionIcon = require('../../assets/js/helpers/changeExtensionIcon');
describe('changeExtensionIcon', function () {
it('should be a function', function () {
expect(changeExtensionIcon).to.be.a('function');
});
});

View File

@@ -1,13 +0,0 @@
var chai = require('chai');
var expect = chai.expect;
var changeExtensionState = require('../../assets/js/helpers/changeExtensionState');
describe('changeExtensionState', function () {
beforeEach(() => {
browser = window;
});
it('should be a function', function () {
expect(changeExtensionState).to.be.a('function');
});
});

View File

@@ -1,18 +0,0 @@
var chai = require('chai');
var expect = chai.expect;
var in_array = require('../../assets/js/helpers/in_array');
describe('in_array', function () {
it('should be a function', function () {
expect(in_array).to.be.a('function');
});
it('should find the needle and return true', function () {
expect(in_array('4', ['4', '3', '2', '1'])).to.equal(true);
});
it('should not find the needle and it should return false', function () {
expect(in_array('5', ['4', '3', '2', '1'])).to.equal(false);
});
});

View File

@@ -1,7 +1,8 @@
var chai = require('chai');
var sinon = require('sinon');
var chrome = require('sinon-chrome');
var expect = chai.expect;
import chai from 'chai';
import sinon from 'sinon';
import chrome from 'sinon-chrome';
const expect = chai.expect;
describe('Chrome Dev Tools', function () {
it('should work', function () {

View File

@@ -0,0 +1,20 @@
import chai from 'chai';
import changeExtensionIcon from '../../src/utils/changeExtensionIcon';
const expect = chai.expect;
jest.mock('webextension-polyfill', () => {
return {
runtime: {
getManifest: () => {
return { version: 'test-version' };
},
},
};
});
describe('changeExtensionIcon', function () {
it('should be a function', function () {
expect(changeExtensionIcon).to.be.a('function');
});
});

View File

@@ -0,0 +1,20 @@
import chai from 'chai';
import changeExtensionState from '../../src/utils/changeExtensionState';
const expect = chai.expect;
jest.mock('webextension-polyfill', () => {
return {
runtime: {
getManifest: () => {
return { version: 'test-version' };
},
},
};
});
describe('changeExtensionState', function () {
it('should be a function', function () {
expect(changeExtensionState).to.be.a('function');
});
});

View File

@@ -1,9 +1,18 @@
var chai = require('chai');
var sinon = require('sinon-chai');
var chrome = require('sinon-chrome');
var expect = chai.expect;
import chai from 'chai';
import changeExtensionTooltip from '../../src/utils/changeExtensionTooltip';
const expect = chai.expect;
jest.mock('webextension-polyfill', () => {
return {
runtime: {
getManifest: () => {
return { version: 'test-version' };
},
},
};
});
var changeExtensionTooltip = require('../../assets/js/helpers/changeExtensionTooltip');
describe('changeExtensionTooltip', function () {
it('should be a function', function () {
expect(changeExtensionTooltip).to.be.a('function');

View File

@@ -1,7 +1,7 @@
var chai = require('chai');
var expect = chai.expect;
import chai from 'chai';
import contains from '../../src/utils/contains';
var contains = require('../../assets/js/helpers/contains');
const expect = chai.expect;
describe('contains', function () {
it('should be a function', function () {
@@ -9,16 +9,16 @@ describe('contains', function () {
});
it('should match url against blacklist and return true', function () {
var list = 'localhost\ntest.com';
const list = 'localhost\ntest.com';
var url = 'http://localhost/fooapp';
const url = 'http://localhost/fooapp';
expect(contains(url, list)).to.equal(true);
});
it('should not match url against blacklist and return false', function () {
var list = 'localhost2\ntest.com';
const list = 'localhost2\ntest.com';
var url = 'http://localhost/fooapp';
const url = 'http://localhost/fooapp';
expect(contains(url, list)).to.equal(false);
});
});

View File

@@ -1,7 +1,7 @@
var chai = require('chai');
var expect = chai.expect;
import chai from 'chai';
import getDomainFromUrl from '../../src/utils/getDomainFromUrl';
var getDomainFromUrl = require('../../assets/js/helpers/getDomainFromUrl');
const expect = chai.expect;
describe('getDomainFromUrl', function () {
it('should be a function', function () {

View File

@@ -0,0 +1,18 @@
import chai from 'chai';
import inArray from '../../src/utils/inArray';
const expect = chai.expect;
describe('inArray', function () {
it('should be a function', function () {
expect(inArray).to.be.a('function');
});
it('should find the needle and return true', function () {
expect(inArray('4', ['4', '3', '2', '1'])).to.equal(true);
});
it('should not find the needle and it should return false', function () {
expect(inArray('5', ['4', '3', '2', '1'])).to.equal(false);
});
});