Skip to content
Snippets Groups Projects
Commit 8197ae4c authored by Matteo Ferrari's avatar Matteo Ferrari
Browse files

Merge branch 'wip-disable-zsp' into 'master'

:sparkles: disable ZSP feature

See merge request !49
parents fb833736 28d9e33e
No related branches found
No related tags found
1 merge request!49:sparkles: disable ZSP feature
Pipeline #3055519 passed
Showing
with 303 additions and 81 deletions
......@@ -45,6 +45,7 @@
"@types/dirty-chai": "^2.0.2",
"@types/jquery": "^3.5.4",
"@types/lodash": "^4.14.163",
"@types/mocha": "^9.0.0",
"@types/node": "^14.14.6",
"@types/q": "^1.5.4",
"@vue/test-utils": "=1.1.3",
......
......@@ -8,16 +8,14 @@ mixin ParamReadonly
.row.no-gutters(:id='channelId')
.col-12
BaseCollapsible(:class="{ 'text-muted': !enabled }" :expand='showAcq || showZsp')
BaseCollapsible(:class="{ 'text-muted': !currentEnabled }" :expand='showAcq || showZsp')
template(v-slot:header)
.row
.col-6.col-md-3
input(v-if='!inEdit' type="checkbox" v-model="enabled" :disabled="true")
// disconnect from "enabled" to not trigger collapse/expand action
input(v-else type="checkbox"
:checked='enabled' @click.stop
@change='pushEditValue("enabled", $event.target.checked)')
strong.pl-1 CHANNEL{{channel}}
.row.no-gutters
BaseToggle.col-auto(ref='enabled' :value='enabled' :inEdit='inEdit'
@click.native.stop @edit='pushEditValue("enabled", $event)')
.col-auto #[strong CHANNEL{{channel}}]
.col-6(v-if="isLoading || isSending") #[i.fa.fa-spinner.fa-pulse]
.col-6(v-else) {{detectorType}}
......@@ -56,9 +54,12 @@ mixin ParamReadonly
BaseCollapsible.x-zsp(:expand='showZsp')
template(v-slot:header)
strong Zero Suppression
.row.no-gutters
BaseToggle.col-auto(ref='isZSP' :value='isZSP' :inEdit='inEdit'
@click.stop.native @edit='onZSPEdit')
.col-auto #[strong Zero Suppression]
.col-12
.row.b-param-container
.row.b-param-container(v-show='!inEdit || isZSPEdit')
BaseParamList.col-12.col-sm-6.col-lg-4.col-xl-2(ref="thresholdSign"
:value="thresholdSign" :inEdit="inEdit"
:options='[ { value: 1, text: "+" }, { value: 0, text: "-" } ]'
......@@ -76,6 +77,17 @@ mixin ParamReadonly
+Param(ref="postSamples" title="Post Samples [S]"
:value="postSamples" :inEdit="inEdit"
@edit='pushEditValue("postSamples", $event)')
.row.b-param-container(v-if='inEdit && !isZSPEdit')
+ParamReadonly(title="Signal Leading Edge"
:value="edit.thresholdSign ? '+' : '-'" :inEdit="inEdit")
+ParamReadonly(title="Threshold [mV]"
:value="edit.threshold" :inEdit="inEdit")
+ParamReadonly(title="∅ Delay [ns]"
:value="edit.zsStart" :inEdit="inEdit")
+ParamReadonly(title="Pre Samples [S]"
:value="edit.preSamples" :inEdit="inEdit")
+ParamReadonly(title="Post Samples [S]"
:value="edit.postSamples" :inEdit="inEdit")
</template>
<script>
......
// @ts-check
import Vue from "vue";
import { assign, constant, get, isFunction, map, mapValues, toNumber } from 'lodash';
import {
assign, constant, get, isFunction, map, mapValues, toNumber, toString
} from 'lodash';
import { mapState } from 'vuex';
import d from 'debug';
......@@ -32,7 +34,9 @@ var debug = d('daq:chan');
* threshold: V.Instance<Param>,
* zsStart: V.Instance<Param>,
* preSamples: V.Instance<Param>,
* postSamples: V.Instance<Param>
* postSamples: V.Instance<Param>,
* enabled: V.Instance<Param>,
* isZSP: V.Instance<Param>
* }} Refs
* @typedef {V.Instance<typeof component, V.ExtVue<typeof options, Refs>> &
* V.Instance<typeof StoreWatchMixin>} Instance
......@@ -58,11 +62,12 @@ const component = /** @type {V.Constructor<typeof options, Refs>} */ (Vue).exten
/**
* @returns {{
* isLoading: boolean,
* isSending: boolean
* } & {[p: string]: any}}
* isSending: boolean,
* isZSPEdit: boolean
* } & {[p in keyof ParamsMap]: any}}
*/
data() {
return assign({ isLoading: true, isSending: false },
return assign({ isLoading: true, isSending: false, isZSPEdit: false },
mapValues(ParamsMap, constant(null)));
},
computed: {
......@@ -72,11 +77,13 @@ const component = /** @type {V.Constructor<typeof options, Refs>} */ (Vue).exten
})),
/** @return {boolean} */
showAcq() {
return (this.acqExpanded === "all") || (this.acqExpanded && this.enabled);
return !!((this.acqExpanded === "all") ||
(this.acqExpanded && this.currentEnabled));
},
/** @return {boolean} */
showZsp() {
return (this.zspExpanded === "all") || (this.zspExpanded && this.enabled);
return !!((this.zspExpanded === "all") ||
(this.zspExpanded && this.currentEnabled));
},
/**
* @this {Instance}
......@@ -132,17 +139,24 @@ const component = /** @type {V.Constructor<typeof options, Refs>} */ (Vue).exten
*/
FullScaleValues() {
return get(CardLimits, [ this.card.type, 'FullScaleLimits', 'values' ]);
}
},
watch: {
/**
* @this {Instance}
* @param {boolean} value
*/
enabled(value) {
if (this.inEdit) {
this.pushEditValue('enabled', value);
}
},
/** @return {boolean} */
currentEnabled() {
return this.inEdit ? this.edit.enabled : this.enabled;
},
/** @return {number} */
timeWindow() {
if (!this.sampleRate) { return 0; }
/* parseFloat will remove trailing zeroes */
return parseFloat((this.sampleSize / this.sampleRate).toFixed(3));
},
/** @return {boolean} */
isZSP() {
return (this.zsStart || 0) < (this.timeWindow * 1e6);
},
/** @return {{[p in keyof ParamsMap]: any}}} */
edit() {
return get(this.$store, [ 'state', 'eacs', 'daq', this.daq.name, 'edit', this.channelId ], {});
}
},
/** @this {Instance} */
......@@ -202,6 +216,15 @@ const component = /** @type {V.Constructor<typeof options, Refs>} */ (Vue).exten
this.isSending = true;
await this.source.chanSources[this.channelId].send();
this.isSending = false;
},
/** @this {Instance} */
onZSPEdit(value) {
this.isZSPEdit = value;
if (!this.inEdit) { return; }
this.$refs.zsStart.editValue = toString(this.isZSPEdit ?
0 : (this.timeWindow * 1e6));
this.pushEditValue('isZSP', this.isZSPEdit);
}
}
});
......
......@@ -54,6 +54,7 @@ BaseCard.x-daqtable(ref="mainCard" tabIndex='-1').highlightOnFocus
th.text-center Lower Limit [mV]
th.text-center(v-show='mediaXL' title='Impedance [Ω]') Imp. [Ω]
th.text-center(title='Zero Suppression') ∅
th.text-center ∅ Signal Leading Edge
th.text-center ∅ Threshold [mV]
th.text-center(v-show='mediaXL') ∅ Delay [ns]
......
......@@ -70,28 +70,33 @@ tr(v-show='enabled || showDisabled' :class='{ "text-muted": !enabled }')
BaseSelect.mw-3(ref='impedance' :value="impedance" :inEdit='inEdit'
:options="ImpedanceValues" :noEditIcon='true'
@edit='pushValue("impedance", $event)')
td.py-0.text-center
BaseToggle.p-0(ref='isZSP' :value='isZSP' @edit='onZSPEdit' :inEdit='inEdit')
td.py-0.text-center
BaseSelect.mw-3(ref='thresholdSign' :value="thresholdSign" :inEdit='inEdit' :noEditIcon='true'
v-show='!(inEdit && !isZSPEdit)'
:options='[ { value: 1, text: "+" }, { value: 0, text: "-" } ]'
@edit='pushValue("thresholdSign", $event)')
BaseInput.mw-3(v-if='inEdit && !isZSPEdit'
:value='thresholdSign ? "+" : "-"' :inEdit='inEdit' :noEditIcon='true' :disabled='true')
td.py-0.text-center
BaseInput.mw-5(ref='threshold' :value="threshold" :inEdit='inEdit' :noEditIcon='true'
type='number' step='any'
@wheel.native='$event.target.blur()'
@edit='pushValue("threshold", $event)')
@edit='pushValue("threshold", $event)' :disabled='inEdit && !isZSPEdit')
td.py-0.text-center(v-show='mediaXL')
BaseInput.mw-5(ref='zsStart' type='number' :value="zsStart" :inEdit='inEdit' :noEditIcon='true'
@wheel.native='$event.target.blur()'
@edit='pushValue("zsStart", $event)')
@edit='pushValue("zsStart", $event)' :disabled='inEdit && !isZSPEdit')
td.py-0.text-center.text-nowrap(v-show='!inEdit && mediaXL') {{ preSamples }} / {{ postSamples }}
td.py-0.text-center(v-show='inEdit && mediaXL')
BaseInput.mw-5(ref='preSamples' type='number' :value="preSamples" :inEdit="true" :noEditIcon='true'
@wheel.native='$event.target.blur()'
@edit='pushValue("preSamples", $event)')
@edit='pushValue("preSamples", $event)' :disabled='inEdit && !isZSPEdit')
td.py-0.text-center(v-show='inEdit && mediaXL')
BaseInput.mw-5(ref='postSamples' type='number' :value="postSamples" :inEdit="true" :noEditIcon='true'
@wheel.native='$event.target.blur()'
@edit='pushValue("postSamples", $event)')
@edit='pushValue("postSamples", $event)' :disabled='inEdit && !isZSPEdit')
</template>
<script>
......
// @ts-check
import Vue from "vue";
import { assign, constant, get, isFunction, isNil, map, mapValues, toNumber } from 'lodash';
import {
assign, constant, get, isFunction, isNil, map, mapValues, toNumber, toString
} from 'lodash';
import MatchMediaMixin from '../../mixins/BaseMatchMediaMixin';
import { StoreWatchMixin } from '../../utilities';
import { ChannelParamsMap as ParamsMap } from '../../interfaces/daq';
......@@ -35,11 +37,11 @@ const component = /** @type {V.Constructor<typeof options, any>} */ (Vue).extend
},
/**
* @return {{ [p in keyof ParamsMap]: any } &
* { maxEditTimeWindow: number, selected: boolean }
* { maxEditTimeWindow: number, selected: boolean, isZSPEdit: boolean }
* }
*/
data() {
return assign({ maxEditTimeWindow: 0, selected: false },
return assign({ maxEditTimeWindow: 0, selected: false, isZSPEdit: false },
mapValues(ParamsMap, constant(null)));
},
computed: {
......@@ -127,6 +129,12 @@ const component = /** @type {V.Constructor<typeof options, any>} */ (Vue).extend
*/
FullScaleValues() {
return get(CardLimits, [ this.card.type, 'FullScaleLimits', 'values' ]);
},
/**
* @return {boolean}
*/
isZSP() {
return (this.zsStart || 0) < (this.timeWindow * 1e6);
}
},
watch: {
......@@ -234,6 +242,19 @@ const component = /** @type {V.Constructor<typeof options, any>} */ (Vue).extend
if (toNumber(this.$refs.offset.editValue) > offsetLimits || toNumber(this.$refs.offset.editValue) < -offsetLimits) {
this.$refs.offset.addWarning('exceeded', 'offset should be below ' + offsetLimits + ' and above ' + (-offsetLimits));
}
},
/**
* @this {Instance}
* @param {boolean} value
*/
onZSPEdit(value) {
this.isZSPEdit = value;
if (!this.inEdit) { return; }
// not using timeWindow editValue since ref exist only on first channel
// (uses "-" on others)
this.$refs.zsStart.editValue = toString(this.isZSPEdit ?
0 : (this.timeWindow * 1e6));
this.pushValue('isZSP', this.isZSPEdit);
}
}
});
......
......@@ -32,7 +32,6 @@ export const AcqState = {
QUEUING_BUFFERS_FOR_WRITER: 7
};
/** @type ParamMap */
export const ChannelParamsMap = {
enabled: { index: 1, type: ParamType.BOOL },
detectorType: { index: 2, type: ParamType.STRING },
......
// @ts-check
import { assign, cloneDeep, findKey, forEach, get, isEmpty, isNil, map, set, without } from 'lodash';
import {
assign, cloneDeep, forEach, get, isEmpty, isNil, map, set, toString,
without } from 'lodash';
import d from 'debug';
import Vue from 'vue';
import { genDataSet, parseValue } from '../../interfaces';
import { ChannelParamsMap, ZSPMap, ZSPMode } from '../../interfaces/daq';
import { ChannelParamsMap, ZSPMap } from '../../interfaces/daq';
const debug = d('store:daq');
......@@ -273,8 +275,16 @@ export const DaqConfigStore = {
* @returns {Promise<*>}
*/
async send(context /*: ActionContext<DaqConfig$StoreState> */, source /*: DaqChannelSource */) {
const config = get(context.state, [ 'edit', source.id ]);
if (!get(config, 'isZSP', true)) {
debug('disabling ZSP on channel:%s', source.id);
const sampleSize = get(config, [ 'sampleSize' ], 0);
const sampleRate = get(config, [ 'sampleRate' ], 1);
config.zsStart = toString(sampleSize / sampleRate * 1e6);
}
const changes = genDataSet(config, ChannelParamsMap);
/* always fully configure all channels */
const changes = genDataSet(get(context.state, [ 'edit', source.id ]), ChannelParamsMap);
if (!isEmpty(changes)) {
debug('sending channel params to %s', source.id);
// @ts-ignore
......
......@@ -4,6 +4,9 @@ const
Server = require('../../src/Server');
/**
* @param {any} env
*/
function createApp(env) {
var def = q.defer();
......@@ -19,9 +22,4 @@ function createApp(env) {
return def.promise;
}
function delay(ms /*: number */) /*: Promise<void> */ {
return new Promise((resolve) => { setTimeout(resolve, ms); });
}
module.exports = { createApp, delay };
module.exports = { createApp };
......@@ -18,7 +18,9 @@ declare var serverRequire: (string) => any
*/
describe('Alarms', function() {
let wrapper/*: Vue$Wrapper */;
/** @type {Tests.Wrapper} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
......@@ -27,7 +29,7 @@ describe('Alarms', function() {
const { NTOFStub } = serverRequire('ntof-stubs');
this.env = {};
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
this.env.stub = new NTOFStub();
......@@ -59,7 +61,7 @@ describe('Alarms', function() {
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* $FlowIgnore */
// @ts-ignore
wrapper = null;
}
});
......
......@@ -16,7 +16,9 @@ declare var serverRequire: (string) => any
*/
describe('BeamLine', function() {
let wrapper/*: Vue$Wrapper */;
/** @type {Tests.Wrapper} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
......@@ -25,7 +27,7 @@ describe('BeamLine', function() {
const { NTOFStub } = serverRequire('ntof-stubs');
this.env = {};
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
this.env.stub = new NTOFStub();
......@@ -57,7 +59,7 @@ describe('BeamLine', function() {
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* $FlowIgnore */
// @ts-ignore
wrapper = null;
}
});
......
......@@ -14,19 +14,30 @@ import Cards from '../src/components/Cards/CardsLayout.vue';
// jshint unused:false
import { default as store } from '../src/store';
/*::
declare var serverRequire: (string) => any
*/
/**
* @typedef {typeof import('../src/components/Cards/Daq.vue').default} Daq
* @typedef {typeof import('../src/components/Cards/DaqCard.vue').default} DaqCard
*/
/**
* @param {Tests.Wrapper} wrapper
* @return {Promise<{
* daqs: Tests.WrapperArray<V.Instance<Daq>>,
* daq: Tests.Wrapper<V.Instance<Daq>>,
* card: Tests.Wrapper<V.Instance<DaqCard>>
* }>}
*/
export async function waitDaqInit(wrapper) {
const daqs = await waitForWrapper(wrapper,
() => wrapper.findAllComponents({ name: 'Daq' }));
const daqs = /** @type {Tests.WrapperArray<V.Instance<Daq>>} */ (
await waitForWrapper(wrapper,
() => wrapper.findAllComponents({ name: 'Daq' })));
expect(daqs.length).to.equal(2);
const daq = daqs.at(0);
await waitForValue(daq, () => daq.vm.isLoading, false);
const card = wrapper.findComponent({ name: 'DaqCard' });
const card = /** @type {Tests.Wrapper<V.Instance<DaqCard>>} */ (
wrapper.findComponent({ name: 'DaqCard' }));
expect(card.exists()).to.be.true();
wrapper.findAllComponents({ name: 'BaseCollapsible' })
......@@ -38,7 +49,9 @@ export async function waitDaqInit(wrapper) {
describe('Cards', function() {
let wrapper/*: Vue$Wrapper */;
/** @type {Tests.Wrapper} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
......@@ -47,7 +60,7 @@ describe('Cards', function() {
const { NTOFStub } = serverRequire('ntof-stubs');
this.env = {};
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
this.env.stub = new NTOFStub({
......@@ -84,7 +97,7 @@ describe('Cards', function() {
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* $FlowIgnore */
// @ts-ignore
wrapper = null;
}
});
......
// @ts-check
import './karma_index';
import * as utilities from "../src/utilities";
import { afterEach, beforeEach, describe, it } from 'mocha';
import { mount } from '@vue/test-utils';
import server from 'karma-server-side';
import { expect } from 'chai';
import { waitFor, waitForValue } from './utils';
import Cards from '../src/components/Cards/CardsLayout.vue';
import { waitDaqInit } from './test_Cards';
// jshint unused:false
import { default as store } from '../src/store';
/**
* @typedef {typeof import('../src/components/Cards/DaqTable.vue').default} DaqTable
* @typedef {typeof import('../src/components/Cards/DaqTableChannel.vue').default} DaqTableChannel
* @typedef {typeof import('@cern/base-vue').BaseInput} BaseInput
*/
describe('Cards DaqTable', function() {
/** @type {Tests.Wrapper<any>} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
return server.run(function() {
const utils = serverRequire('./test/server_utils');
const { NTOFStub } = serverRequire('ntof-stubs');
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
this.env.stub = new NTOFStub({
daqs: [
{ crateId: 12, layout: [ 4, 2 ] },
{ crateId: 11, layout: [ 1 ] }
]
});
return this.env.stub.init();
})
.then(() => {
var addr = this.env.server.address();
return {
dns: this.env.stub.dns.url().substr(6),
proxyUrl: `http://localhost:${addr.port}`
};
});
})
.then((ret) => {
utilities.setCurrentUrl(ret.proxyUrl);
env = ret;
});
});
afterEach(async function() {
await server.run(function() {
this.env.server.close();
this.env.stub.close();
this.env = null;
});
store.commit('queryChange', { dns: null });
});
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* @ts-ignore: simplifies tests */
wrapper = null;
}
});
it('can disable ZSP', async function() {
store.commit('queryChange', { dns: env.dns });
wrapper = mount(Cards, { });
const { daq } = await waitDaqInit(wrapper);
await waitForValue(daq, () => daq.vm.isLoading, false);
/** @type {Tests.Wrapper<V.Instance<DaqTable>>} */
const table = wrapper.findComponent({ name: 'DaqTable' });
expect(table.exists()).to.be.true();
table.find('.fa-cog').trigger('click');
await waitForValue(table, () => table.vm.inEdit, true);
const channel =
/** @type {Tests.Wrapper<V.Instance<DaqTableChannel>>} */ (wrapper.findComponent({ name: 'DaqTableChannel' }));
expect(channel.exists()).to.be.true();
expect(channel.vm.isZSP).to.be.true();
const zsStart = /** @type {Tests.Wrapper<V.Instance<BaseInput>>} */
(channel.findComponent({ ref: 'zsStart' }));
expect(zsStart.exists()).to.be.true();
await waitFor(zsStart, () => zsStart.vm.editValue === '0');
channel.findComponent({ ref: 'isZSP' })
.findAll('input').trigger('click');
await waitFor(zsStart, () => zsStart.vm.editValue !== '0');
channel.findComponent({ ref: 'isZSP' })
.findAll('input').trigger('click');
await waitFor(zsStart, () => zsStart.vm.editValue === '0');
channel.findComponent({ ref: 'isZSP' })
.findAll('input').trigger('click');
await waitFor(zsStart, () => zsStart.vm.editValue !== '0');
table.findAll('button')
.filter((b) => b.text() === 'Configure')
.trigger('click');
await waitForValue(channel, () => channel.vm.isZSP, false);
});
});
......@@ -22,7 +22,9 @@ declare var serverRequire: (string) => any
*/
describe('Cards', function() {
let wrapper/*: Vue$Wrapper */;
/** @type {Tests.Wrapper} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
......@@ -31,7 +33,7 @@ describe('Cards', function() {
const { NTOFStub } = serverRequire('ntof-stubs');
this.env = {};
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
this.env.stub = new NTOFStub({
......@@ -68,7 +70,7 @@ describe('Cards', function() {
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* $FlowIgnore */
// @ts-ignore
wrapper = null;
}
});
......
......@@ -16,7 +16,9 @@ declare var serverRequire: (string) => any
*/
describe('Control', function() {
let wrapper/*: Vue$Wrapper */;
/** @type {Tests.Wrapper} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
......@@ -26,7 +28,7 @@ describe('Control', function() {
const { DisXmlNode } = serverRequire('dim-xml');
const { EACSStub } = serverRequire('ntof-stubs');
this.env = {};
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
this.env.dns = new DnsServer(null, 0);
......@@ -72,7 +74,7 @@ describe('Control', function() {
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* $FlowIgnore */
// @ts-ignore
wrapper = null;
}
});
......
......@@ -17,7 +17,9 @@ declare var serverRequire: (string) => any
*/
describe('Control', function() {
let wrapper/*: Vue$Wrapper */;
/** @type {Tests.Wrapper} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
......@@ -26,7 +28,7 @@ describe('Control', function() {
const { NTOFStub } = serverRequire('ntof-stubs');
this.env = {};
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
this.env.stub = new NTOFStub({
......@@ -63,7 +65,7 @@ describe('Control', function() {
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* $FlowIgnore */
// @ts-ignore
wrapper = null;
}
});
......
......@@ -17,7 +17,9 @@ declare var serverRequire: (string) => any
*/
describe('Control', function() {
let wrapper/*: Vue$Wrapper */;
/** @type {Tests.Wrapper} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
......@@ -27,7 +29,7 @@ describe('Control', function() {
const { DisXmlNode } = serverRequire('dim-xml');
const { EACSStub } = serverRequire('ntof-stubs');
this.env = {};
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
this.env.dns = new DnsServer(null, 0);
......@@ -70,7 +72,7 @@ describe('Control', function() {
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* $FlowIgnore */
// @ts-ignore
wrapper = null;
}
});
......
......@@ -20,7 +20,9 @@ declare var serverRequire: (string) => any
*/
describe('Control', function() {
let wrapper/*: Vue$Wrapper */;
/** @type {Tests.Wrapper} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
......@@ -29,7 +31,7 @@ describe('Control', function() {
const { DisXmlNode } = serverRequire('dim-xml');
const { NTOFStub } = serverRequire('ntof-stubs');
this.env = {};
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
this.env.node = new DisXmlNode(null, 0);
......@@ -70,7 +72,7 @@ describe('Control', function() {
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* $FlowIgnore */
// @ts-ignore
wrapper = null;
}
});
......
......@@ -18,7 +18,9 @@ declare var serverRequire: (string) => any
*/
describe('HighVoltage', function() {
let wrapper/*: Vue$Wrapper */;
/** @type {Tests.Wrapper} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
......@@ -27,7 +29,7 @@ describe('HighVoltage', function() {
const { NTOFStub } = serverRequire('ntof-stubs');
this.env = {};
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
const config = {
......@@ -65,7 +67,7 @@ describe('HighVoltage', function() {
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* $FlowIgnore */
// @ts-ignore
wrapper = null;
}
});
......
......@@ -18,7 +18,9 @@ declare var serverRequire: (string) => any
*/
describe('Materials', function() {
let wrapper/*: Vue$Wrapper */;
/** @type {Tests.Wrapper} */
let wrapper;
/** @type {any} */
let env;
beforeEach(function() {
......@@ -27,7 +29,7 @@ describe('Materials', function() {
const { DisXmlNode } = serverRequire('dim-xml');
const { NTOFStub } = serverRequire('ntof-stubs');
this.env = {};
this.env = /** @type {any} */({});
return utils.createApp(this.env)
.then(() => {
this.env.node = new DisXmlNode(null, 0);
......@@ -68,7 +70,7 @@ describe('Materials', function() {
afterEach(function() {
if (wrapper) {
wrapper.destroy();
/* $FlowIgnore */
// @ts-ignore
wrapper = null;
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment