Skip to content
Snippets Groups Projects
Commit b262e066 authored by Lotte Hofstede's avatar Lotte Hofstede
Browse files

40416: more tests and docs

parent 6aff818d
No related branches found
No related tags found
No related merge requests found
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);
});
});
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'
......
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'],
......
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'],
......
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 {
......
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) {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment