|
5 | 5 | * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
6 | 6 | */
|
7 | 7 |
|
| 8 | +import { join } from 'path'; |
8 | 9 | import * as sinon from 'sinon';
|
9 | 10 | import { expect } from 'chai';
|
10 | 11 | import { Logger } from '@salesforce/core';
|
@@ -78,14 +79,15 @@ describe('RetrieveResultFormatter', () => {
|
78 | 79 | expect(formatter.getJson()).to.deep.equal(expectedInProgressResults);
|
79 | 80 | });
|
80 | 81 |
|
81 |
| - it.skip('should return expected json for a success with packages', async () => { |
| 82 | + it('should return expected json for a success with packages', async () => { |
| 83 | + const testPkg = { name: 'testPkg', path: join('path', 'to', 'testPkg') }; |
82 | 84 | const expectedSuccessResults: RetrieveCommandResult = {
|
83 | 85 | inboundFiles: retrieveResultSuccess.getFileResponses(),
|
84 |
| - packages: [], |
| 86 | + packages: [testPkg], |
85 | 87 | warnings: [],
|
86 | 88 | response: cloneJson(retrieveResultSuccess.response),
|
87 | 89 | };
|
88 |
| - const formatter = new RetrieveResultFormatter(logger, ux, {}, retrieveResultSuccess); |
| 90 | + const formatter = new RetrieveResultFormatter(logger, ux, { packages: [testPkg] }, retrieveResultSuccess); |
89 | 91 | expect(formatter.getJson()).to.deep.equal(expectedSuccessResults);
|
90 | 92 | });
|
91 | 93 |
|
@@ -127,10 +129,11 @@ describe('RetrieveResultFormatter', () => {
|
127 | 129 | .and.contain(`${options.waitTime} minutes`);
|
128 | 130 | });
|
129 | 131 |
|
130 |
| - it.skip('should output as expected for a Failure', async () => { |
131 |
| - const formatter = new RetrieveResultFormatter(logger, ux, {}, retrieveResultInProgress); |
| 132 | + it('should output as expected for a Failure', async () => { |
| 133 | + const formatter = new RetrieveResultFormatter(logger, ux, {}, retrieveResultFailure); |
| 134 | + sandbox.stub(formatter, 'isSuccess').returns(false); |
| 135 | + |
132 | 136 | formatter.display();
|
133 |
| - expect(styledHeaderStub.called).to.equal(true); |
134 | 137 | expect(logStub.called).to.equal(true);
|
135 | 138 | expect(tableStub.called).to.equal(false);
|
136 | 139 | expect(logStub.firstCall.args[0]).to.contain('Retrieve Failed due to:');
|
|
0 commit comments