Skip to content

Commit

Permalink
Updated test title comments for client-unit tests in xml test report …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
jmcameron committed Dec 8, 2023
1 parent f6bafd0 commit 4ccfbd6
Show file tree
Hide file tree
Showing 15 changed files with 159 additions and 178 deletions.
6 changes: 3 additions & 3 deletions test/client-unit/components/bhBarcoderScanner.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint no-unused-expressions:off */
/* global inject, expect, chai */

describe('test/client-unit/components/bhBarcodeScanner', bhBarcodeScannerTests);
describe('test/client-unit/components/bhBarcodeScanner', () => {

function bhBarcodeScannerTests() {
const template = `
<bh-barcode-scanner on-scan-callback="callback(record)">
</bh-barcode-scanner>
Expand Down Expand Up @@ -143,4 +142,5 @@ function bhBarcodeScannerTests() {
const span = find(element, '.text-danger');
expect(angular.element(span).attr('data-error')).to.equal('READ_ERROR');
});
}

});
7 changes: 3 additions & 4 deletions test/client-unit/components/bhCardList.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint no-unused-expressions:off */
/* global inject expect */
describe('test/client-unit/components/bhCardList', bhCardListTests);

function bhCardListTests() {
describe('test/client-unit/components/bhCardList', () => {
let $compile;
let $rootScope;
let $templateCache;
Expand Down Expand Up @@ -172,4 +170,5 @@ function bhCardListTests() {
firstCardTitle = find(firstCard, '[data-test-card-title]');
expect(firstCardTitle).to.contain.text('A: Test Card');
});
}

});
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint no-unused-expressions:off */
/* global inject, expect, chai */

describe('test/client-unit/components/bhCheckboxTree', bhCheckboxTree);
describe('test/client-unit/components/bhCheckboxTree', () => {

function bhCheckboxTree() {
beforeEach(module(
'pascalprecht.translate',
'bhima.services',
Expand Down Expand Up @@ -96,4 +95,5 @@ function bhCheckboxTree() {

expect($scope.callback).to.have.been.called();
});
}

});
14 changes: 6 additions & 8 deletions test/client-unit/components/bhDateEditor.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint no-unused-expressions:off */
/* global inject, expect, chai */

describe('test/client-unit/components/bhDateEditor', bhDateEditorTests);
describe('test/client-unit/components/bhDateEditor', () => {

function bhDateEditorTests() {
const template = `
<bh-date-editor date-value="date" on-change="callback(date)">
</bh-date-editor>
Expand All @@ -25,7 +24,7 @@ function bhDateEditorTests() {
'bhima.constants',
'templates',
'bhima.mocks',
'ui.router'
'ui.router',
));

let $scope;
Expand All @@ -38,7 +37,7 @@ function bhDateEditorTests() {

const enterpriseFiscalStartDate = '2015-01-01T00:00:00.000Z';
const futureDate = '2200-01-20';
const invalidOldDate = '2001-01-20';
// ??? const invalidOldDate = '2001-01-20';

// utility fns
const find = (elm, selector) => elm[0].querySelector(selector);
Expand Down Expand Up @@ -95,7 +94,6 @@ function bhDateEditorTests() {
it('changing the date value should fire the onChange event', () => {
const input = find(element, '[data-date-editor-input]');


// make sure the input is not readonly
clickOnCalendarButton(element);

Expand All @@ -106,7 +104,6 @@ function bhDateEditorTests() {
expect($scope.callback).to.have.been.called();
});


it('Should not allow future date to be selected', () => {
const input = find(element, '[data-date-editor-input]');
clickOnCalendarButton(element);
Expand Down Expand Up @@ -138,7 +135,7 @@ function bhDateEditorTests() {
});

describe('limit-min-fiscal flag', () => {
let fiscalLimitElement = `
const fiscalLimitElement = `
<bh-date-editor date-value="date" limit-min-fiscal></bh-date-editor>
`;
let fiscalElement;
Expand All @@ -151,4 +148,5 @@ function bhDateEditorTests() {
expect(spy).to.have.been.called.exactly(1);
});
});
}

});
7 changes: 3 additions & 4 deletions test/client-unit/components/bhFilterToggle.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint no-unused-expressions:off */
/* global inject, expect, chai */
describe('test/client-unit/components/bhFilterToggle', bhFilterToggleTests);

function bhFilterToggleTests() {
describe('test/client-unit/components/bhFilterToggle', () => {
let $scope;
let element;

Expand All @@ -29,4 +27,5 @@ function bhFilterToggleTests() {
angular.element(btn).click();
expect($scope.callback).to.have.been.called.once;
});
}

});
6 changes: 3 additions & 3 deletions test/client-unit/components/bhFindInvoice.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint no-unused-expressions:off */
/* global inject, expect, chai */

describe('test/client-unit/components/bhFindInvoice', bhFindInvoiceTests);
describe('test/client-unit/components/bhFindInvoice', () => {

function bhFindInvoiceTests() {
const patient = {
uuid : '234c51ae-efcc-4238-98c6-f402bfb39866',
reference : 'TPA17',
Expand Down Expand Up @@ -206,4 +205,5 @@ function bhFindInvoiceTests() {
btn.click();
$scope.$digest();
}
}

});
6 changes: 3 additions & 3 deletions test/client-unit/components/bhHiddenField.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint no-unused-expressions:off */
/* global inject, expect */

describe('test/client-unit/components/bhHiddenField', bhHiddenFieldTests);
describe('test/client-unit/components/bhHiddenField', () => {

function bhHiddenFieldTests() {
const template = `
<bh-hidden-field show-text="OPEN" hide-text="CLOSE">
<p id="test">TEST</p>
Expand Down Expand Up @@ -70,4 +69,5 @@ function bhHiddenFieldTests() {
transclusion = find(element, '[bh-hidden-field-transclude]');
expect(transclusion).not.to.exist;
});
}

});
6 changes: 3 additions & 3 deletions test/client-unit/components/bhModalNotify.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint no-unused-expressions:off */
/* global inject, expect */

describe('test/client-unit/components/bhModalNotify', bhModalNotifyTests);
describe('test/client-unit/components/bhModalNotify', () => {

function bhModalNotifyTests() {
const template = `
<bh-modal-notify error="someError"></bh-modal-notify>
`;
Expand Down Expand Up @@ -178,4 +177,5 @@ function bhModalNotifyTests() {
const successComponentLoaded = find(dangerComponentAsked, '.notification-success');
expect(successComponentLoaded).to.equal(null);
});
}

});
3 changes: 1 addition & 2 deletions test/client-unit/services/StockService.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* global inject, expect */

describe('test/client-unit/services/StockService', StockServiceTests);
describe('test/client-unit/services/StockService', () => {

function StockServiceTests() {
// define modules
beforeEach(module(
'bhima.services',
Expand Down
1 change: 0 additions & 1 deletion test/integration/patientInvoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ function InvoicingFeeScenario() {
.catch(helpers.handler);
});


/*
* This scenario tests that subsidies work properly. The simple subsidy will
* absorb some of a patient's cost into a subsidy account. The API only
Expand Down
1 change: 1 addition & 0 deletions test/integration/reports/finance/open_debtors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const RenderingTests = require('../rendering');

const target = '/reports/finance/debtors/open';
const options = {
currencyId : 1,
Expand Down
50 changes: 23 additions & 27 deletions test/server-unit/bhMoment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,30 @@ function evaluate(startDate, endDate, dateBhMoment) {
expect(formated).to.deep.equal(expected);
}

describe('test/server-unit', () => {

describe('bhMoment', () => {

it('#day() should return the start and stop dates of the given date', () => {
const startDate = '2019-08-24';
const endDate = '2019-08-24';
evaluate(startDate, endDate, date.day());
});

it('#week() should return the start and stop dates of the week for the given date', () => {
const startDate = '2019-08-18';
const endDate = '2019-08-24';
evaluate(startDate, endDate, date.week());
});

it('#month() should return the start and stop dates of the month for the given date', () => {
const startDate = '2019-08-01';
const endDate = '2019-08-31';
evaluate(startDate, endDate, date.month());
});

it('#year() should return the start and stop dates of the year for the given date', () => {
const startDate = '2019-01-01';
const endDate = '2019-12-31';
evaluate(startDate, endDate, date.year());
});
describe('test/server-unit bhMoment', () => {

it('#day() should return the start and stop dates of the given date', () => {
const startDate = '2019-08-24';
const endDate = '2019-08-24';
evaluate(startDate, endDate, date.day());
});

it('#week() should return the start and stop dates of the week for the given date', () => {
const startDate = '2019-08-18';
const endDate = '2019-08-24';
evaluate(startDate, endDate, date.week());
});

it('#month() should return the start and stop dates of the month for the given date', () => {
const startDate = '2019-08-01';
const endDate = '2019-08-31';
evaluate(startDate, endDate, date.month());
});

it('#year() should return the start and stop dates of the year for the given date', () => {
const startDate = '2019-01-01';
const endDate = '2019-12-31';
evaluate(startDate, endDate, date.year());
});

});

0 comments on commit 4ccfbd6

Please sign in to comment.