Skip to content

Commit

Permalink
fix: import FileProperties from the top level (#3302)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcamp authored Jun 10, 2021
1 parent 487e99f commit c0a94a1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
RetrieveResult,
SourceComponent
} from '@salesforce/source-deploy-retrieve';
import { FileProperties } from '@salesforce/source-deploy-retrieve/lib/src/client/types';
import { FileProperties } from '@salesforce/source-deploy-retrieve';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { FileProperties } from '@salesforce/source-deploy-retrieve/lib/src/client/types';
import { FileProperties } from '@salesforce/source-deploy-retrieve';
import {
ExtensionContext,
Memento
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import {
ComponentSet,
FileProperties,
MetadataApiRetrieve,
RetrieveResult
} from '@salesforce/source-deploy-retrieve';
import {
FileProperties,
MetadataApiRetrieveStatus,
RequestStatus
} from '@salesforce/source-deploy-retrieve/lib/src/client/types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

import { FileProperties } from '@salesforce/source-deploy-retrieve/lib/src/client/types';
import { FileProperties } from '@salesforce/source-deploy-retrieve';
import { expect } from 'chai';
import { join } from 'path';
import { PersistentStorageService } from '../../../src/conflict/persistentStorageService';
import { MockContext } from '../telemetry/MockContext';

describe('Persistant Storage Service', () => {
describe('Persistent Storage Service', () => {
const props: FileProperties[] = [
{
id: '1',
createdById: '2',
createdByName: 'Me',
createdDate: 'Today',
fileName: 'classes/One.cls',
fileName: join('classes', 'One.cls'),
fullName: 'One',
lastModifiedById: '3',
lastModifiedByName: 'You',
Expand All @@ -29,7 +30,7 @@ describe('Persistant Storage Service', () => {
createdById: '2',
createdByName: 'Me',
createdDate: 'Yesterday',
fileName: 'objects/Two.object',
fileName: join('objects', 'Two.cls'),
fullName: 'Two',
lastModifiedById: '2',
lastModifiedByName: 'Me',
Expand All @@ -46,12 +47,12 @@ describe('Persistant Storage Service', () => {
it('Should store and retrieve file properties in Memento cache', () => {
const cache = PersistentStorageService.getInstance();
cache.setPropertiesForFiles(props);
expect(cache.getPropertiesForFile('classes/One.cls')).to.deep.equal({lastModifiedDate: 'Tomorrow'});
expect(cache.getPropertiesForFile('objects/Two.object')).to.deep.equal({lastModifiedDate: 'Yesterday'});
cache.setPropertiesForFile('classes/One.cls', undefined);
cache.setPropertiesForFile('objects/Two.object', undefined);
expect(cache.getPropertiesForFile('classes/One.cls')).to.equal(undefined);
expect(cache.getPropertiesForFile('objects/Two.object')).to.equal(undefined);
expect(cache.getPropertiesForFile(join('classes', 'One.cls'))).to.deep.equal({lastModifiedDate: 'Tomorrow'});
expect(cache.getPropertiesForFile(join('objects', 'Two.cls'))).to.deep.equal({lastModifiedDate: 'Yesterday'});
cache.setPropertiesForFile(join('classes', 'One.cls'), undefined);
cache.setPropertiesForFile(join('objects', 'Two.cls'), undefined);
expect(cache.getPropertiesForFile(join('classes', 'One.cls'))).to.equal(undefined);
expect(cache.getPropertiesForFile(join('objects', 'Two.cls'))).to.equal(undefined);
});

});

0 comments on commit c0a94a1

Please sign in to comment.