[CORL-158] Open/Close stream inside of configure tab (#2223)

* feat: Open or Close stream inside of configure tab

* feat: default disable/close commenting message

* fix: adjusted tests
This commit is contained in:
Kiwi
2019-03-19 18:30:44 +01:00
committed by GitHub
parent 5a7340ac3a
commit 41db413bea
34 changed files with 783 additions and 208 deletions
@@ -2,7 +2,6 @@ import React from "react";
import { ReactTestInstance } from "react-test-renderer";
import findParentsWithType from "./findParentsWithType";
import findParentWithType from "./findParentWithType";
import matchText, { TextMatchOptions, TextMatchPattern } from "./matchText";
const matcher = (pattern: TextMatchPattern, options?: TextMatchOptions) => (
@@ -39,14 +38,17 @@ export function getByText(
pattern: TextMatchPattern,
options?: TextMatchOptions & SelectorOptions
) {
const result = findParentWithType(
container.find(matcher(pattern, options)),
const results = findParentsWithType(
container.findAll(matcher(pattern, options)),
options && options.selector
);
if (!result) {
throw new Error(`Couldn't find text ${pattern}`);
if (results.length === 1) {
return results[0];
}
return result;
if (results.length === 0) {
throw new Error(`Could't find element with text ${pattern}`);
}
throw new Error(`Found multiple elements with text ${pattern}`);
}
export function getAllByText(