-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { buildItemPath } from '@/config/paths'; | ||
import { DROPZONE_HELPER_ID } from '@/config/selectors'; | ||
|
||
import { SAMPLE_ITEMS, SAMPLE_PUBLIC_ITEMS } from '../../../fixtures/items'; | ||
|
||
describe('home screen - dropzone helper visibility', () => { | ||
beforeEach(() => { | ||
cy.setUpApi(); | ||
}); | ||
|
||
it('should display dropzone helper on the home screen when no items', () => { | ||
cy.visit('/'); | ||
cy.get(`#${DROPZONE_HELPER_ID}`).should('be.visible'); | ||
}); | ||
}); | ||
|
||
describe('empty folder - dropzone helper visibility', () => { | ||
it('user logs in - show dropzone helper when no items', () => { | ||
cy.setUpApi(SAMPLE_ITEMS); | ||
cy.visit(buildItemPath(SAMPLE_ITEMS.items[1].id)); | ||
cy.get(`#${DROPZONE_HELPER_ID}`).should('be.visible'); | ||
}); | ||
|
||
it('user logs out - hide dropzone helper', () => { | ||
cy.setUpApi({ ...SAMPLE_PUBLIC_ITEMS, currentMember: null }); | ||
cy.visit(buildItemPath(SAMPLE_PUBLIC_ITEMS.items[2].id)); | ||
cy.get(`#${DROPZONE_HELPER_ID}`).should('not.exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters