Uploaded image for project: 'Nuxeo Elements'
  1. Nuxeo Elements
  2. ELEMENTS-1139

Fix importHref not calling its callbacks

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0-SNAPSHOT
    • Fix Version/s: 3.1.x, 3.0.x
    • Component/s: UI

      Description

      Take into account the following test (applicable to nuxeo-layout.test.js:

        test('Broken importHref', async () => {
            // first run
            let layout = await fixture(
              html`
                <nuxeo-layout href="notfound.html"></nuxeo-layout>
              `,
            );
            await flush();
      
            let nuxeoError = layout.$.error;
            if (!isElementVisible(nuxeoError)) {
              await waitForAttrMutation(nuxeoError, 'hidden', null);
            }
            expect(isElementVisible(layout.$.container)).to.be.false;
            expect(isElementVisible(nuxeoError)).to.be.true;
      
            // second run
            layout = await fixture(
              html`
                <nuxeo-layout href="notfound.html"></nuxeo-layout>
              `,
            );
            await flush();
      
            nuxeoError = layout.$.error;
            if (!isElementVisible(nuxeoError)) {
              await waitForAttrMutation(nuxeoError, 'hidden', null);
            }
            expect(isElementVisible(layout.$.container)).to.be.false;
            expect(isElementVisible(nuxeoError)).to.be.true;
          });
      

      The second run will fail, because the error will never be visible and no layout was stamped. This seems to be resulting from neither the resolve nor the reject of importHref being called. Surprisingly, changing the layout href to "notfound2.html" will fix the issue, which seems to suggest that there might be an issue with multiple elements having the same href resulting in a 404?

      This is also reproducible on storybook, which stops displaying document layouts after the "Not Found Story" is selected more than once. This story was added under ELEMENTS-1098.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: