mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 18:44:14 +00:00
40416: more tests and docs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { ProtractorPage } from './simple-item-page.po';
|
||||
|
||||
describe('protractor Simple Item Page', function() {
|
||||
describe('protractor Simple Item Page', function () {
|
||||
let page: ProtractorPage;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -9,11 +9,19 @@ describe('protractor Simple Item Page', function() {
|
||||
});
|
||||
|
||||
it('should contain element ds-thumbnail"', () => {
|
||||
expect(page.elementTagExists("ds-thumbnail")).toEqual(true);
|
||||
expect(page.elementSelectorExists("ds-thumbnail img")).toEqual(true);
|
||||
});
|
||||
|
||||
it('should contain element h1.item-page-title-field"', () => {
|
||||
expect(page.elementSelectorExists("h1.selector")).toEqual(true);
|
||||
it('should contain element an h2 title field"', () => {
|
||||
expect(page.elementSelectorExists("h2.item-page-title-field")).toEqual(true);
|
||||
});
|
||||
|
||||
it('should contain element link to its collections"', () => {
|
||||
expect(page.elementTagExists("ds-item-page-collections")).toEqual(true);
|
||||
});
|
||||
|
||||
it('should contain a file section"', () => {
|
||||
expect(page.elementTagExists("ds-item-page-file-section")).toEqual(true);
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { browser, element, by } from 'protractor';
|
||||
|
||||
export class ProtractorPage {
|
||||
ITEMPAGE : string = "/items/8766";
|
||||
ITEMPAGE : string = "/items/8871";
|
||||
|
||||
navigateToSimpleItemPage() {
|
||||
return browser.get(this.ITEMPAGE);
|
||||
|
@@ -3,6 +3,11 @@ import { Collection } from "../../core/shared/collection.model";
|
||||
import { Observable } from "rxjs";
|
||||
import { Item } from "../../core/shared/item.model";
|
||||
|
||||
/**
|
||||
* This component renders the parent collections section of the item
|
||||
* inside a 'ds-metadata-field-wrapper' component.
|
||||
*/
|
||||
|
||||
@Component({
|
||||
selector: 'ds-item-page-collections',
|
||||
templateUrl: './collections.component.html'
|
||||
|
@@ -3,6 +3,11 @@ import { Bitstream } from "../../core/shared/bitstream.model";
|
||||
import { Item } from "../../core/shared/item.model";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
/**
|
||||
* This component renders the file section of the item
|
||||
* inside a 'ds-metadata-field-wrapper' component.
|
||||
*/
|
||||
|
||||
@Component({
|
||||
selector: 'ds-item-page-file-section',
|
||||
templateUrl: './file-section.component.html'
|
||||
|
@@ -1,5 +1,10 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
|
||||
/**
|
||||
* This component renders any content inside this wrapper.
|
||||
* The wrapper prints a label before the content (if available)
|
||||
*/
|
||||
|
||||
@Component({
|
||||
selector: 'ds-metadata-field-wrapper',
|
||||
styleUrls: ['./metadata-field-wrapper.component.css'],
|
||||
|
@@ -1,6 +1,14 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { MetadataValuesComponent } from "../metadata-values/metadata-values.component";
|
||||
|
||||
/**
|
||||
* This component renders the configured 'values' into the ds-metadata-field-wrapper component as a link.
|
||||
* It puts the given 'separator' between each two values
|
||||
* and creates an 'a' tag for each value,
|
||||
* using the 'linktext' as it's value (if it exists)
|
||||
* and using the values as the 'href' attribute (and as value of the tag when no 'linktext' is defined)
|
||||
*/
|
||||
|
||||
@Component({
|
||||
selector: 'ds-metadata-uri-values',
|
||||
styleUrls: ['./metadata-uri-values.component.css'],
|
||||
|
@@ -1,5 +1,10 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
|
||||
/**
|
||||
* This component renders the configured 'values' into the ds-metadata-field-wrapper component.
|
||||
* It puts the given 'separator' between each two values.
|
||||
*/
|
||||
|
||||
@Component({
|
||||
selector: 'ds-metadata-values',
|
||||
styleUrls: ['./metadata-values.component.css'],
|
||||
|
@@ -9,6 +9,7 @@ import { Pipe, PipeTransform } from '@angular/core';
|
||||
* {{ 1024 | fileSize}}
|
||||
* formats to: 1 KB
|
||||
*/
|
||||
|
||||
@Pipe({name: 'dsFileSize'})
|
||||
export class FileSizePipe implements PipeTransform {
|
||||
|
||||
|
@@ -1,6 +1,11 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
/**
|
||||
* This pipe explicitly escapes the sanitization of a URL,
|
||||
* only use this when you are sure the URL is indeed safe
|
||||
*/
|
||||
|
||||
@Pipe({name: 'dsSafeUrl'})
|
||||
export class SafeUrlPipe implements PipeTransform {
|
||||
constructor(private domSanitizer: DomSanitizer) {}
|
||||
|
Reference in New Issue
Block a user