-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
21349 - Todo section & affiliation invitations. (#15)
* 21349 - Todo section & affiliation invitations. * 21349 - Eslint fixes and c&p cleanup. * 21349 - Adding the tests. * eslint fix.
- Loading branch information
Showing
20 changed files
with
628 additions
and
55 deletions.
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 |
---|---|---|
|
@@ -9,6 +9,9 @@ dist | |
# Node dependencies | ||
node_modules | ||
|
||
# cypress | ||
cypress/screenshots | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
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,38 @@ | ||
context('TODOs -> Affiliation Requests', () => { | ||
it('Tood section is rendered when there are affiliation requests', () => { | ||
cy.visitBusinessDashFor('businessInfo/ben/active.json', undefined, true) | ||
|
||
cy.fixture('todos/affiliationRequests.json').then((afrMockResponse) => { | ||
// section exists | ||
cy.get('[data-cy="header_todo"]').should('exist') | ||
|
||
// item list exist | ||
cy.get('[data-cy="todoItemList"]').should('exist') | ||
|
||
// verify affiliation items exist | ||
cy.get('[data-cy="todoItem-affiliation"]') | ||
.should('have.length', afrMockResponse.affiliationInvitations.length) | ||
|
||
// verify buttons are here | ||
cy.get('[data-cy="todoItem-affiliation-showMore"]') | ||
.should('have.length', afrMockResponse.affiliationInvitations.length) | ||
cy.get('[data-cy="todoItem-affiliation-doNotAuthorizeButton"]') | ||
.should('have.length', afrMockResponse.affiliationInvitations.length) | ||
cy.get('[data-cy="todoItem-affiliation-authorizeButton"]') | ||
.should('have.length', afrMockResponse.affiliationInvitations.length) | ||
|
||
// no body of todo item expanded | ||
cy.get('[data-cy="todoItemBody-affiliation"]').should('not.exist') | ||
cy.get('Hide details').should('not.exist') | ||
|
||
cy.get('[data-cy="todoItem-affiliation-showMore"]').first().click() | ||
|
||
cy.get('[data-cy="todoItemBody-affiliation"]').should('exist') | ||
|
||
// no body of todo item hidden | ||
cy.get('[data-cy="todoItem-affiliation-showMore"]').first().click() | ||
|
||
cy.get('[data-cy="todoItemBody-affiliation"]').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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"affiliationInvitations": [ | ||
{ | ||
"additionalMessage": "", | ||
"businessIdentifier": "BC0814603", | ||
"expiresOn": "2024-07-05T22:19:41+00:00", | ||
"fromOrg": { | ||
"id": 3101, | ||
"name": "Kial Dev 2 (BTR test account)", | ||
"orgType": "PREMIUM" | ||
}, | ||
"id": 344, | ||
"isDeleted": false, | ||
"recipientEmail": "[email protected],[email protected],[email protected]", | ||
"sentDate": "2024-07-05T22:04:41+00:00", | ||
"status": "PENDING", | ||
"toOrg": { | ||
"id": 3113, | ||
"name": "Kial Dev 1 (BTR test account)", | ||
"orgType": "PREMIUM" | ||
}, | ||
"token": ".eJyrVspMUbIyNjHRUUorys_1L0r3BPENDQx1lEry4VxDYx2lpNLizLzU4mLPlNS8ksy0zNQiJSslJ2cDC0MTMwNjpVoATksWSQ.Zoht-g.NYyfPARLpGSrkdmt1CO5I6L2MTM", | ||
"type": "REQUEST" | ||
}, | ||
{ | ||
"additionalMessage": "This is additional message, please make sure its seen !!!", | ||
"businessIdentifier": "BC0814603", | ||
"expiresOn": "2024-07-05T22:19:41+00:00", | ||
"fromOrg": { | ||
"id": 3102, | ||
"name": "Kial Dev 3 (BTR test account)", | ||
"orgType": "PREMIUM" | ||
}, | ||
"id": 344, | ||
"isDeleted": false, | ||
"recipientEmail": "[email protected],[email protected],[email protected]", | ||
"sentDate": "2024-07-05T22:04:41+00:00", | ||
"status": "PENDING", | ||
"toOrg": { | ||
"id": 3113, | ||
"name": "Kial Dev 1 (BTR test account)", | ||
"orgType": "PREMIUM" | ||
}, | ||
"token": ".eJyrVspMUbIyNjHRUUorys_1L0r3BPENDQx1lEry4VxDYx2lpNLizLzU4mLPlNS8ksy0zNQiJSslJ2cDC0MTMwNjpVoATksWSQ.Zoht-g.NYyfPARLpGSrkdmt1CO5I6L2MTM", | ||
"type": "REQUEST" | ||
} | ||
] | ||
} |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,33 @@ | ||
<template> | ||
<BcrosTodoItemsAffiliation | ||
v-if="displayItem===DisplayItem.AffiliationInvitation" | ||
:todo-item="item" | ||
:for-business-name="business.currentBusiness.legalName" | ||
/> | ||
|
||
<div v-if="displayItem===DisplayItem.None"> | ||
NONE NONE | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { TodoItemI } from '~/interfaces/todo-i' | ||
const business = useBcrosBusiness() | ||
const props = defineProps({ | ||
item: { type: Object as PropType<TodoItemI>, required: true } | ||
}) | ||
enum DisplayItem { | ||
None, | ||
AffiliationInvitation | ||
} | ||
let displayItem = DisplayItem.None | ||
if (props.item.affiliationInvitationDetails) { | ||
displayItem = DisplayItem.AffiliationInvitation | ||
} | ||
</script> |
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,21 @@ | ||
<template> | ||
<div | ||
class="flex flex-col gap-1.5 bg-gray-100" | ||
data-cy="todoItemList" | ||
> | ||
<BcrosTodoItem | ||
v-for="todoItem in todos" | ||
:key="todoItem.uiUuid" | ||
:item="todoItem" | ||
:title="todoItem.title" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { TodoItemI } from '~/interfaces/todo-i' | ||
defineProps({ | ||
todos: { type: Array<TodoItemI>, required: true } | ||
}) | ||
</script> |
Oops, something went wrong.