Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: import FileProperties from the top level #3302

Merged
merged 3 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
});

});