Skip to content

Commit

Permalink
feat: add favorite star to dashboard and chart lists (apache#10510)
Browse files Browse the repository at this point in the history
  • Loading branch information
riahk authored and auxten committed Nov 20, 2020
1 parent 9e58cef commit 6f3974f
Show file tree
Hide file tree
Showing 12 changed files with 525 additions and 298 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,27 @@ describe('Dashboard add to favorite', () => {

it('should allow favor/unfavor', () => {
if (!isFavoriteDashboard) {
cy.get('.favstar').find('i').should('have.class', 'fa-star-o');
cy.get('.favstar').trigger('click');
cy.get('.favstar')
.find('i')
.should('have.class', 'fa-star')
.and('not.have.class', 'fa-star-o');
cy.get('a.fave-unfave-icon')
.find('svg')
.should('have.attr', 'data-test', 'favorite-unselected');
cy.get('a.fave-unfave-icon').trigger('click');
cy.get('a.fave-unfave-icon')
.find('svg')
.should('have.attr', 'data-test', 'favorite-selected')
.and('not.have.attr', 'data-test', 'favorite-unselected');
} else {
cy.get('.favstar')
.find('i')
.should('have.class', 'fa-star')
.and('not.have.class', 'fa-star-o');
cy.get('.favstar').trigger('click');
cy.get('.fave-unfave-icon')
.find('i')
.should('have.class', 'fa-star-o')
.and('not.have.class', 'fa-star');
cy.get('a.fave-unfave-icon')
.find('svg')
.should('have.attr', 'data-test', 'favorite-unselected')
.and('not.have.attr', 'data-test', 'favorite-selected');
cy.get('a.fave-unfave-icon').trigger('click');
cy.get('a.fave-unfave-icon')
.find('svg')
.should('have.attr', 'data-test', 'favorite-unselected')
.and('not.have.attr', 'data-test', 'favorite-selected');
}

// reset to original fav state
cy.get('.favstar').trigger('click');
cy.get('a.fave-unfave-icon').trigger('click');
});
});
21 changes: 21 additions & 0 deletions superset-frontend/images/icons/favorite-selected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions superset-frontend/images/icons/favorite-unselected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6f3974f

Please sign in to comment.