fix: #36322 HistoryWrapper constructor history param not work (#36367) (#36399)

(cherry picked from commit 63715dcdef)

Co-authored-by: MeetzhDing <meet.zhding@foxmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-07-05 09:02:35 +02:00
committed by GitHub
co-authored by MeetzhDing
parent fc45cf178e
commit 862c9a2c73
@@ -31,9 +31,10 @@ export class HistoryWrapper implements LocationService {
constructor(history?: H.History) {
// If no history passed create an in memory one if being called from test
this.history =
history || process.env.NODE_ENV === 'test'
history ||
(process.env.NODE_ENV === 'test'
? H.createMemoryHistory({ initialEntries: ['/'] })
: H.createBrowserHistory({ basename: config.appSubUrl ?? '/' });
: H.createBrowserHistory({ basename: config.appSubUrl ?? '/' }));
this.partial = this.partial.bind(this);
this.push = this.push.bind(this);