[ADF-3591] spellcheck support for code (#3827)

* setup spellcheck
This commit is contained in:
Denys Vuika
2018-10-23 15:05:38 +01:00
committed by Eugenio Romano
parent 53d96679ea
commit e39a2b149b
262 changed files with 1561 additions and 1005 deletions

View File

@@ -273,6 +273,7 @@ describe('AuthenticationService', () => {
it('[BPM] should return an BPM ticket after the login done', (done) => {
let disposableLogin = authService.login('fake-username', 'fake-password').subscribe((response) => {
expect(authService.isLoggedIn()).toBe(true);
// cspell: disable-next
expect(authService.getTicketBpm()).toEqual('Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk');
expect(authService.isBpmLoggedIn()).toBe(true);
disposableLogin.unsubscribe();
@@ -376,6 +377,7 @@ describe('AuthenticationService', () => {
let disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => {
expect(authService.isLoggedIn()).toBe(true);
expect(authService.getTicketEcm()).toEqual('fake-post-ticket');
// cspell: disable-next
expect(authService.getTicketBpm()).toEqual('Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk');
expect(authService.isBpmLoggedIn()).toBe(true);
expect(authService.isEcmLoggedIn()).toBe(true);
@@ -401,6 +403,7 @@ describe('AuthenticationService', () => {
(err: any) => {
expect(authService.isLoggedIn()).toBe(false, 'isLoggedIn');
expect(authService.getTicketEcm()).toBe(undefined, 'getTicketEcm');
// cspell: disable-next
expect(authService.getTicketBpm()).toBe('Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk', 'getTicketBpm');
expect(authService.isEcmLoggedIn()).toBe(false, 'isEcmLoggedIn');
disposableLogin.unsubscribe();

View File

@@ -186,7 +186,7 @@ export class ContentService {
/**
* Gets a Node via its node ID.
* @param nodeId ID of the target node
* @param opts Options supported by JSAPI
* @param opts Options supported by JS-API
* @returns Details of the folder
*/
getNode(nodeId: string, opts?: any): Observable<NodeEntry> {

View File

@@ -38,7 +38,7 @@ export class DeletedNodesApiService {
/**
* Gets a list of nodes in the trash.
* @param options Options for JSAPI call
* @param options Options for JS-API call
* @returns List of nodes in the trash
*/
getDeletedNodes(options?: Object): Observable<NodePaging> {

View File

@@ -68,7 +68,7 @@ export class FavoritesApiService {
/**
* Gets the favorites for a user.
* @param personId ID of the user
* @param options Options supported by JSAPI
* @param options Options supported by JS-API
* @returns List of favorites
*/
getFavorites(personId: string, options?: any): Observable<NodePaging> {

View File

@@ -17,7 +17,7 @@
import { Injectable } from '@angular/core';
export interface HightlightTransformResult {
export interface HighlightTransformResult {
text: string;
changed: boolean;
}
@@ -34,7 +34,7 @@ export class HighlightTransformService {
* @param wrapperClass CSS class used to provide highlighting style
* @returns New text along with boolean value to indicate whether anything was highlighted
*/
public highlight(text: string, search: string, wrapperClass: string = 'highlight'): HightlightTransformResult {
public highlight(text: string, search: string, wrapperClass: string = 'highlight'): HighlightTransformResult {
let isMatching = false,
result = text;

View File

@@ -42,7 +42,7 @@ export class NodesApiService {
/**
* Gets the stored information about a node.
* @param nodeId ID of the target node
* @param options Optional parameters supported by JSAPI
* @param options Optional parameters supported by JS-API
* @returns Node information
*/
getNode(nodeId: string, options: any = {}): Observable<MinimalNodeEntryEntity> {
@@ -62,7 +62,7 @@ export class NodesApiService {
/**
* Gets the items contained in a folder node.
* @param nodeId ID of the target node
* @param options Optional parameters supported by JSAPI
* @param options Optional parameters supported by JS-API
* @returns List of child items from the folder
*/
getNodeChildren(nodeId: string, options: any = {}): Observable<NodePaging> {
@@ -84,7 +84,7 @@ export class NodesApiService {
* Creates a new document node inside a folder.
* @param parentNodeId ID of the parent folder node
* @param nodeBody Data for the new node
* @param options Optional parameters supported by JSAPI
* @param options Optional parameters supported by JS-API
* @returns Details of the new node
*/
createNode(parentNodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity> {
@@ -101,7 +101,7 @@ export class NodesApiService {
* Creates a new folder node inside a parent folder.
* @param parentNodeId ID of the parent folder node
* @param nodeBody Data for the new folder
* @param options Optional parameters supported by JSAPI
* @param options Optional parameters supported by JS-API
* @returns Details of the new folder
*/
createFolder(parentNodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity> {
@@ -113,7 +113,7 @@ export class NodesApiService {
* Updates the information about a node.
* @param nodeId ID of the target node
* @param nodeBody New data for the node
* @param options Optional parameters supported by JSAPI
* @param options Optional parameters supported by JS-API
* @returns Updated node information
*/
updateNode(nodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity> {
@@ -134,7 +134,7 @@ export class NodesApiService {
/**
* Moves a node to the trashcan.
* @param nodeId ID of the target node
* @param options Optional parameters supported by JSAPI
* @param options Optional parameters supported by JS-API
* @returns Empty result that notifies when the deletion is complete
*/
deleteNode(nodeId: string, options: any = {}): Observable<any> {

View File

@@ -65,6 +65,7 @@ describe('AppTitle service', () => {
});
it('should update title on language change', () => {
// cspell: disable-next
spyOn(translationService, 'instant').and.returnValues('hello', 'привет');
pageTitleService.setTitle('key');
@@ -73,10 +74,12 @@ describe('AppTitle service', () => {
(<any> titleService).setTitle.calls.reset();
translationService.translate.onLangChange.next(<any> {});
// cspell: disable-next
expect(titleServiceSpy).toHaveBeenCalledWith('привет - My application');
});
it('should update title on new content download', () => {
// cspell: disable-next
spyOn(translationService, 'instant').and.returnValues('hello', 'привет');
pageTitleService.setTitle('key');
@@ -85,6 +88,7 @@ describe('AppTitle service', () => {
(<any> titleService).setTitle.calls.reset();
translationService.translate.onTranslationChange.next(<any> {});
// cspell: disable-next
expect(titleServiceSpy).toHaveBeenCalledWith('привет - My application');
});
});

View File

@@ -16,7 +16,7 @@
*/
import { TestBed } from '@angular/core/testing';
import { fakeRedition, fakeReditionCreated, fakeReditionsList } from '../mock/renditionsService.mock';
import { fakeRendition, fakeRenditionCreated, fakeRenditionsList } from '../mock/renditionsService.mock';
import { RenditionsService } from './renditions.service';
import { setupTestBed } from '../testing/setupTestBed';
import { CoreModule } from '../core.module';
@@ -55,7 +55,7 @@ describe('RenditionsService', () => {
jasmine.Ajax.requests.mostRecent().respondWith({
'status': 200,
contentType: 'application/json',
responseText: JSON.stringify(fakeReditionsList)
responseText: JSON.stringify(fakeRenditionsList)
});
});
@@ -107,7 +107,7 @@ describe('RenditionsService', () => {
jasmine.Ajax.requests.mostRecent().respondWith({
'status': 200,
contentType: 'application/json',
responseText: JSON.stringify(fakeRedition)
responseText: JSON.stringify(fakeRendition)
});
});
@@ -132,7 +132,7 @@ describe('RenditionsService', () => {
jasmine.Ajax.requests.mostRecent().respondWith({
'status': 200,
contentType: 'application/json',
responseText: JSON.stringify(fakeReditionCreated)
responseText: JSON.stringify(fakeRenditionCreated)
});
});
@@ -145,7 +145,7 @@ describe('RenditionsService', () => {
jasmine.Ajax.requests.mostRecent().respondWith({
'status': 200,
contentType: 'application/json',
responseText: JSON.stringify(fakeRedition)
responseText: JSON.stringify(fakeRendition)
});
});

View File

@@ -37,7 +37,7 @@ export class SharedLinksApiService {
/**
* Gets shared links available to the current user.
* @param options Options supported by JSAPI
* @param options Options supported by JS-API
* @returns List of shared links
*/
getSharedLinks(options: any = {}): Observable<NodePaging> {
@@ -57,7 +57,7 @@ export class SharedLinksApiService {
/**
* Creates a shared link available to the current user.
* @param nodeId ID of the node to link to
* @param options Options supported by JSAPI
* @param options Options supported by JS-API
* @returns The shared link just created
*/
createSharedLinks(nodeId: string, options: any = {}): Observable<SharedLinkEntry> {

View File

@@ -32,7 +32,7 @@ export class SitesService {
/**
* Gets a list of all sites in the repository.
* @param opts Options supported by JSAPI
* @param opts Options supported by JS-API
* @returns List of sites
*/
getSites(opts: any = {}): Observable<SitePaging> {
@@ -50,7 +50,7 @@ export class SitesService {
/**
* Gets the details for a site.
* @param siteId ID of the target site
* @param opts Options supported by JSAPI
* @param opts Options supported by JS-API
* @returns Information about the site
*/
getSite(siteId: string, opts?: any): Observable<SiteEntry> {

View File

@@ -15,6 +15,7 @@
* limitations under the License.
*/
/* spellchecker: disable */
import { Injectable } from '@angular/core';
import { MatIconRegistry } from '@angular/material';
import { DomSanitizer } from '@angular/platform-browser';

View File

@@ -43,6 +43,7 @@ describe('UploadService', () => {
files: {
excluded: ['.DS_Store', 'desktop.ini', '.git', '*.git', '*.SWF'],
'match-options': {
/* cspell:disable-next-line */
nocase: true
}
}
@@ -269,15 +270,15 @@ describe('UploadService', () => {
let fileFake1 = new FileModel(<File> { name: 'fake-name1', size: 10 });
let fileFake2 = new FileModel(<File> { name: 'fake-name2', size: 10 });
let filelist = [fileFake1, fileFake2];
service.addToQueue(...filelist);
let fileList = [fileFake1, fileFake2];
service.addToQueue(...fileList);
service.uploadFilesInTheQueue(emitter);
let file = service.getQueue();
service.cancelUpload(...file);
});
it('should remove from the queue all the files in the exluded list', () => {
it('should remove from the queue all the files in the excluded list', () => {
const file1 = new FileModel(new File([''], '.git'));
const file2 = new FileModel(new File([''], '.DS_Store'));
const file3 = new FileModel(new File([''], 'desktop.ini'));

View File

@@ -126,7 +126,7 @@ describe('UserPreferencesService', () => {
expect(preferences.getDefaultLocale()).toBe('fake-locate-browser');
});
it('should return as default locale the component propery as third ', () => {
it('should return as default locale the component property as third ', () => {
spyOn(translate, 'getBrowserLang').and.stub();
expect(preferences.getDefaultLocale()).toBe('en');
});