Expected Behavior
Tests should reflect current Document class.
This test is working with ownerId instead of dataContractId.
describe('#getDataContractId', () => {
it('should return $dataContractId', () => {
expect(document.getOwnerId()).to.deep.equal(rawDocument.$ownerId);
});
});
This test is working with the obsolete Document.action:
it('should create Document with undefined action and data if present', () => {
const data = {
test: 1,
};
rawDocument = {
$type: 'test',
...data,
};
document = new Document(rawDocument, dataContract);
expect(document.action).to.equal(undefined);
expect(Document.prototype.setData).to.have.been.calledOnceWith(data);
});
Current Behavior
Presumably tests pass.
Possible Solution
Use dataContractId instead of ownerId in this test.
describe('#getDataContractId', () => {
it('should return $dataContractId', () => {
expect(document.getDataContractId()).to.deep.equal(rawDocument.$dataContractId);
});
});
Remove this test:
'should create Document with undefined action and data if present'
Steps to Reproduce (for bugs)
No tests were actually run. This is from static code analysis.
Context
I am looking at these unit tests to see what can be applied to the Android DPP library.
Your Environment
N/A
Expected Behavior
Tests should reflect current Document class.
This test is working with ownerId instead of dataContractId.
This test is working with the obsolete Document.action:
Current Behavior
Presumably tests pass.
Possible Solution
Use dataContractId instead of ownerId in this test.
Remove this test:
'should create Document with undefined action and data if present'Steps to Reproduce (for bugs)
No tests were actually run. This is from static code analysis.
Context
I am looking at these unit tests to see what can be applied to the Android DPP library.
Your Environment
N/A