[next] Prevent accidental lock out from admin or stream (#2084)

* feat: prevent auth lockout by accident

* test: add integration tests

* test: update snapshots
This commit is contained in:
Kiwi
2018-11-20 17:41:35 +01:00
committed by GitHub
parent ecdb4e1307
commit 9af523318c
15 changed files with 235 additions and 55 deletions
@@ -1,10 +1,10 @@
export default function limitSnapshotTo(id: string, node: any) {
if (node.props && node.props.id === id) {
export default function limitSnapshotTo(dataTest: string, node: any) {
if (node.props && node.props["data-test"] === dataTest) {
return node;
}
if (node.children) {
for (const child of node.children) {
const result: any = limitSnapshotTo(id, child);
const result: any = limitSnapshotTo(dataTest, child);
if (result) {
return result;
}