});
it('shows search context menu', function() {
- const colName = `Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
- const federatedColName = `Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
+ const colName = `Home Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
+ const federatedColName = `Federated Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
const federatedColUuid = "xxxxx-4zz18-000000000000000";
// Intercept config to insert remote cluster
- cy.intercept({method: 'GET', hostname: 'localhost', url: '**/arvados/v1/config?nocache=*'}, (req) => {
+ cy.intercept({method: 'GET', hostname: '127.0.0.1', url: '**/arvados/v1/config?nocache=*'}, (req) => {
req.reply((res) => {
res.body.RemoteClusters = {
"*": res.body.RemoteClusters["*"],
cy.contains('View details');
cy.contains('Copy to clipboard').click();
+ cy.waitForDom();
cy.window().then((win) => (
win.navigator.clipboard.readText().then((text) => {
expect(text).to.match(new RegExp(`/collections/${testCollection.uuid}$`));
cy.get('[data-cy=search-results]').contains(colName).rightclick();
cy.get('[data-cy=context-menu]').within(() => {
cy.contains('Open in new tab').click();
+ cy.waitForDom();
cy.get('@Open').should('have.been.calledOnceWith', `${window.location.origin}/collections/${testCollection.uuid}`)
});
cy.get('[data-cy=search-results]').contains(federatedColName).rightclick();
cy.get('[data-cy=context-menu]').within(() => {
cy.contains('Copy to clipboard').click();
+ cy.waitForDom();
cy.window().then((win) => (
win.navigator.clipboard.readText().then((text) => {
expect(text).to.equal(`https://wb2.xxxxx.fakecluster.tld/collections/${federatedColUuid}`);
cy.get('[data-cy=search-results]').contains(federatedColName).rightclick();
cy.get('[data-cy=context-menu]').within(() => {
cy.contains('Open in new tab').click();
+ cy.waitForDom();
cy.get('@Open').should('have.been.calledWith', `https://wb2.xxxxx.fakecluster.tld/collections/${federatedColUuid}`)
});