diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bc7e7c..a50feec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 3.0.0 + +- Upgrade to react-admin v5 +- The `` will no longer automatically redirect to the app if the user is already authenticated. + ## 2.3.0 * Update supabase-js dev to match new auth system ([#55](https://github.com/marmelab/ra-supabase/pull/55)) ([Revarh](https://github.com/Revarh)) diff --git a/cypress/e2e/dashboard.cy.ts b/cypress/e2e/dashboard.cy.ts index 2758fad..c3a0c92 100644 --- a/cypress/e2e/dashboard.cy.ts +++ b/cypress/e2e/dashboard.cy.ts @@ -5,14 +5,13 @@ describe('Dashboard spec', () => { cy.visit('/'); login(); cy.findByText('Upcoming Deal Revenue').should('exist'); - cy.findByRole('list', { description: 'My Latest Notes' }).within(() => { - cy.findAllByRole('listitem').should('have.length.gt', 0); - }); - cy.findByRole('list', { description: 'Hot contacts' }).within(() => { - cy.findAllByRole('listitem').should('have.length.gt', 0); - }); - cy.findByRole('list', { description: 'Deals Pipeline' }).within(() => { - cy.findAllByRole('listitem').should('have.length.gt', 0); - }); + cy.findByText('My Latest Notes').should('exist'); + cy.findByText('Upcoming tasks').should('exist'); + cy.findByText('Hot contacts').should('exist'); + cy.findByTestId('my-latest-notes') + .find('p') + .should('have.length.gt', 0); + cy.findByTestId('tasks-list').find('li').should('have.length.gt', 0); + cy.findByTestId('hot-contacts').find('li').should('have.length.gt', 0); }); }); diff --git a/cypress/e2e/lists.cy.ts b/cypress/e2e/lists.cy.ts index 6a8986b..f7b350c 100644 --- a/cypress/e2e/lists.cy.ts +++ b/cypress/e2e/lists.cy.ts @@ -1,6 +1,7 @@ import { login } from './login'; -const getPaginationText = () => cy.findByText(/\d+-\d+ of \d+/); +const getPaginationText = () => + cy.findByText(/\d+-\d+ of \d+/, { timeout: 10000 }); describe('Lists', () => { it('should render a list', () => { @@ -91,11 +92,23 @@ describe('Lists', () => { cy.visit('/'); login(); cy.findByText('Contacts').click(); - cy.findAllByText(/\d+ days? ago/).should('have.length.greaterThan', 0); - cy.findAllByText(/\d+ years? ago/).should('have.length', 0); + cy.findAllByText(/\d+ days? ago/, { timeout: 10000 }).should( + 'have.length.greaterThan', + 0 + ); + cy.findAllByText(/\d+ years? ago/, { timeout: 10000 }).should( + 'have.length', + 0 + ); cy.findByText('Sort by Last seen descending').click(); cy.findByText('Last seen ascending').click(); - cy.findAllByText(/\d+ days? ago/).should('have.length', 0); - cy.findAllByText(/\d+ years? ago/).should('have.length.greaterThan', 0); + cy.findAllByText(/\d+ days? ago/, { timeout: 10000 }).should( + 'have.length', + 0 + ); + cy.findAllByText(/\d+ years? ago/, { timeout: 10000 }).should( + 'have.length.greaterThan', + 0 + ); }); }); diff --git a/packages/demo/db-seed.ts b/packages/demo/db-seed.ts index 62924ce..afd8584 100644 --- a/packages/demo/db-seed.ts +++ b/packages/demo/db-seed.ts @@ -91,10 +91,11 @@ async function main() { new Date(a.date).valueOf() - new Date(b.date).valueOf() ) .map(note => { + const relatedContact = persistedContacts.find( + contact => contact.id === note.contact_id + ); return supabase.from('contacts').update({ - ...persistedContacts.find( - contact => contact.id === note.contact_id - ), + ...relatedContact, status: note.status, }); }) @@ -107,7 +108,7 @@ async function main() { }); const { data: persistedDeals, error: errorDeals } = await supabase .from('deals') - .insert(deals.map(({ nb_notes, id, ...deal }) => deal)) + .insert(deals.map(({ id, ...deal }) => deal)) .select(); if (errorDeals) { diff --git a/packages/demo/index.html b/packages/demo/index.html index 217cf85..ac5e949 100644 --- a/packages/demo/index.html +++ b/packages/demo/index.html @@ -9,7 +9,7 @@ - Posters Galore Administration + Atomic CRM