Skip to content

Commit

Permalink
fix(router): sibling-viewport resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
Sayan751 committed Mar 27, 2022
1 parent 80de920 commit 6ed9996
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions packages/__tests__/router-lite/smoke-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ describe.only('router (smoke tests)', function () {
assert.areTaskQueuesEmpty();
});

it.only(`can load a named default with one sibling at a child with mode: ${mode}`, async function () {
it(`can load a named default with one sibling at a child with mode: ${mode}`, async function () {
@customElement({ name: 'b', template: 'b' })
class B {}
@customElement({ name: 'c', template: 'c' })
Expand Down Expand Up @@ -699,7 +699,7 @@ describe.only('router (smoke tests)', function () {
const ctx = TestContext.create();
const { container } = ctx;

container.register(TestRouterConfiguration.for(ctx, LogLevel.trace));
container.register(TestRouterConfiguration.for(ctx, LogLevel.warn));
container.register(RouterConfiguration.customize({ resolutionMode: mode }));

const component = container.get(Root);
Expand All @@ -726,7 +726,6 @@ describe.only('router (smoke tests)', function () {

assertComponentsVisible(host, [Root, [A, [B, C]]], '4');

console.log('\n\n\t\t-------------------------------\n\n');
await router.load('a/c@b');

assertComponentsVisible(host, [Root, [A, [C]]], '5');
Expand Down
3 changes: 2 additions & 1 deletion packages/router-lite/src/route-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ export class RouteContext {
let residue: string | null;
if (Reflect.has(result.params, RESIDUE)) {
residue = result.params[RESIDUE] ?? null;
Reflect.deleteProperty(result.params, RESIDUE);
// TODO(sayan): Fred did this to fix some issue in lazy-loading. Inspect if this is really needed.
// Reflect.deleteProperty(result.params, RESIDUE);
} else {
residue = null;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/router-lite/src/route-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class RouteDefinition {
public toString(): string {
const path = this.config.path === null ? 'null' : `'${this.config.path}'`;
if (this.component !== null) {
return `RD(config.path:${path},c.name:'${this.component.name}')`;
return `RD(config.path:${path},c.name:'${this.component.name}',vp:'${this.viewport}')`;
} else {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
return `RD(config.path:${path},redirectTo:'${this.redirectTo}')`;
Expand Down

0 comments on commit 6ed9996

Please sign in to comment.