misc changes

This commit is contained in:
Nathan Bierema 2021-06-19 10:14:23 -04:00
parent 11c5fd1c57
commit ecb4916b74
10 changed files with 21 additions and 12 deletions

View File

@ -7,7 +7,7 @@ if (process.env.NODE_ENV === 'production') {
(document.head || document.documentElement).appendChild(s);
s.parentNode.removeChild(s);
} else {
s.src = chrome.extension.getURL('js/page.bundle.js');
s.src = chrome.extension.getURL('page.bundle.js');
s.onload = function () {
this.parentNode.removeChild(this);
};

View File

@ -18,7 +18,7 @@ describe('App container', () => {
it('should contain an empty action list', () => {
expect(component.find('ActionList').html()).toMatch(
/<div class="actionListRows-[0-9]+"><\/div>/
/<div class="actionListRows-[0-9-]+"><\/div>/
);
});
});

View File

@ -1,6 +1,6 @@
require('@babel/polyfill');
global.chrome = require('sinon-chrome');
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-15.4';
import Adapter from 'enzyme-adapter-react-16';
Enzyme.configure({ adapter: new Adapter() });

View File

@ -6,26 +6,28 @@ export const delay = (time) =>
export const switchMonitorTests = {
'should switch to Log Monitor': async function () {
await this.driver
.findElement(webdriver.By.xpath('//div[text()="Inspector"]'))
.findElement(webdriver.By.xpath('//button[text()="Inspector"]'))
.click();
await delay(500); // Wait till menu is fully opened
await this.driver
.findElement(webdriver.By.xpath('//div[text()="Log monitor"]'))
.findElement(webdriver.By.xpath('//button[text()="Log monitor"]'))
.click();
await delay(500);
await this.driver.findElement(
webdriver.By.xpath('//div[a[text()="Reset"] and .//a[text()="Revert"]]')
webdriver.By.xpath(
'//div[div[button[text()="Reset"]] and .//div[button[text()="Revert"]]]'
)
);
await delay(500);
},
'should switch to Chart Monitor': async function () {
await this.driver
.findElement(webdriver.By.xpath('//div[text()="Log monitor"]'))
.findElement(webdriver.By.xpath('//button[text()="Log monitor"]'))
.click();
await delay(500); // Wait till menu is fully opened
await this.driver
.findElement(webdriver.By.xpath('//div[text()="Chart"]'))
.findElement(webdriver.By.xpath('//button[text()="Chart"]'))
.click();
await delay(500);
await this.driver.findElement(
@ -36,11 +38,11 @@ export const switchMonitorTests = {
'should switch back to Inspector Monitor': async function () {
await this.driver
.findElement(webdriver.By.xpath('//div[text()="Chart"]'))
.findElement(webdriver.By.xpath('//button[text()="Chart"]'))
.click();
await delay(1000); // Wait till menu is fully opened
await this.driver
.findElement(webdriver.By.xpath('//div[text()="Inspector"]'))
.findElement(webdriver.By.xpath('//button[text()="Inspector"]'))
.click();
await delay(1500); // Wait till menu is closed
},

View File

@ -7,7 +7,7 @@ const mock = `${extpath}chromeAPIMock.js`;
const baseConfig = (params) => ({
// devtool: 'source-map',
mode: 'production',
mode: params.mode,
entry: params.input || {
background: [mock, `${extpath}background/index`],
options: [mock, `${extpath}options/index`],

View File

@ -3,6 +3,7 @@ import webpack from 'webpack';
import baseConfig from './base.config';
let config = baseConfig({
mode: 'development',
inputExtra: {
page: [path.join(__dirname, '../src/browser/extension/inject/pageScript')],
},

View File

@ -2,6 +2,10 @@ import path from 'path';
import baseConfig from './base.config';
export default baseConfig({
mode: 'production',
inputExtra: {
page: [path.join(__dirname, '../src/browser/extension/inject/pageScript')],
},
output: { path: path.join(__dirname, '../build/extension') },
globals: {
'process.env': {

View File

@ -2,6 +2,7 @@ import path from 'path';
import baseConfig from './base.config';
export default baseConfig({
mode: 'production',
output: { path: path.join(__dirname, '../build/extension') },
globals: {
'process.env': {

View File

@ -2,6 +2,7 @@ import path from 'path';
import baseConfig from './base.config';
export default baseConfig({
mode: 'production',
input: {
page: [path.join(__dirname, '../src/browser/extension/inject/pageScript')],
},

View File

@ -1,3 +1,3 @@
module.exports = {
projects: ['<rootDir>/packages/*'],
projects: ['extension', '<rootDir>/packages/*'],
};