diff --git a/static_src/components/space_container.jsx b/static_src/components/space_container.jsx
index 5e3964d0..b6a903b9 100644
--- a/static_src/components/space_container.jsx
+++ b/static_src/components/space_container.jsx
@@ -4,7 +4,7 @@ import React from 'react';
import AppCountStatus from './app_count_status.jsx';
import AppList from '../components/app_list.jsx';
-import Breadcrumbs from './breadcrumbs.jsx';
+import Breadcrumbs from './breadcrumbs';
import EntityIcon from './entity_icon.jsx';
import Loading from './loading.jsx';
import Marketplace from './marketplace.jsx';
@@ -77,20 +77,21 @@ export default class SpaceContainer extends React.Component {
return
;
}
+ const { currentOrg: org, space } = this.state;
+
let main =
;
const title = (
- { this.state.space.name }
+ { space.name }
);
- if (this.state.space && this.state.space.guid) {
- const space = this.state.space;
+ if (space && space.guid) {
main = (
diff --git a/static_src/stores/org_store.js b/static_src/stores/org_store.js
index 25086387..15d24307 100644
--- a/static_src/stores/org_store.js
+++ b/static_src/stores/org_store.js
@@ -1,8 +1,4 @@
-
-/*
- * Store for org data. Will store and update org data on changes from UI and
- * server.
- */
+import PropTypes from 'prop-types';
import AppDispatcher from '../dispatcher';
import BaseStore from './base_store.js';
@@ -10,6 +6,11 @@ import LoginStore from './login_store.js';
import { orgActionTypes } from '../constants.js';
import Quicklook from '../models/quicklook';
+export const orgPropType = PropTypes.shape({
+ guid: PropTypes.string.isRequired,
+ name: PropTypes.string.isRequired
+});
+
export class OrgStore extends BaseStore {
constructor() {
super();
diff --git a/static_src/stores/space_store.js b/static_src/stores/space_store.js
index 74fe60a8..592f405d 100644
--- a/static_src/stores/space_store.js
+++ b/static_src/stores/space_store.js
@@ -4,10 +4,16 @@
*/
import Immutable from 'immutable';
+import PropTypes from 'prop-types';
import BaseStore from './base_store.js';
import { orgActionTypes, spaceActionTypes } from '../constants.js';
+export const spacePropType = PropTypes.shape({
+ guid: PropTypes.string.isRequired,
+ name: PropTypes.string.isRequired
+});
+
class SpaceStore extends BaseStore {
constructor() {
super();
diff --git a/static_src/test/functional/pageobjects/breadcrumbs.element.js b/static_src/test/functional/pageobjects/breadcrumbs.element.js
index 42bce331..257f3411 100644
--- a/static_src/test/functional/pageobjects/breadcrumbs.element.js
+++ b/static_src/test/functional/pageobjects/breadcrumbs.element.js
@@ -1,19 +1,12 @@
-
import BaseElement from './base.element';
-// https://www.martinfowler.com/bliki/PageObject.html
-//
-// Represents a DOM element for making assertions against. This makes it
-// easier to abstract some of the webdriver details from the UI component.
-
-// TODO attach to class as static property
-const breadcrumbs = '.test-breadcrumbs';
+const breadcrumbs = '[data-test="breadcrumbs"]';
const selectors = {
primary: breadcrumbs,
- overview: `${breadcrumbs} li:first-child a`,
- org: `${breadcrumbs} li:nth-child(1) a`,
- space: `${breadcrumbs} li:last-child a`
+ overview: `${breadcrumbs} [data-test="overview"]`,
+ org: `${breadcrumbs} [data-test="org"]`,
+ space: `${breadcrumbs} [data-test="space"]`
};
export default class Breadcrumbs extends BaseElement {
@@ -40,4 +33,3 @@ export default class Breadcrumbs extends BaseElement {
}
Breadcrumbs.primarySelector = selectors.primary;
-