forked from opensearch-project/notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Frontend: update recipient group data modal (opensearch-project#357)
Signed-off-by: Kavitha Conjeevaram Mohan <[email protected]>
- Loading branch information
1 parent
82707ff
commit 0f8088f
Showing
8 changed files
with
58 additions
and
35 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 |
---|---|---|
|
@@ -79,7 +79,7 @@ describe('Test create channels', () => { | |
|
||
// custom data-test-subj does not work on combo box | ||
cy.get('[data-test-subj="comboBoxInput"]').eq(0).click({ force: true }); | ||
cy.contains('Test tls sender').click(); | ||
cy.contains('test-tls-sender').click(); | ||
|
||
cy.get('.euiButton__text') | ||
.contains('Create recipient group') | ||
|
@@ -121,7 +121,7 @@ describe('Test create channels', () => { | |
.contains('Create SES sender') | ||
.click({ force: true }); | ||
cy.get('[data-test-subj="create-ses-sender-form-name-input"]').type( | ||
'Test ses sender' | ||
'test-ses-sender' | ||
); | ||
cy.get('[data-test-subj="create-ses-sender-form-email-input"]').type( | ||
'[email protected]' | ||
|
@@ -166,7 +166,7 @@ describe('Test create channels', () => { | |
}); | ||
|
||
it('creates a sns channel', () => { | ||
cy.get('[placeholder="Enter channel name"]').type('Test sns channel'); | ||
cy.get('[placeholder="Enter channel name"]').type('test-sns-channel'); | ||
cy.get('.euiCheckbox__input[id="reports"]').click({ force: true }); | ||
|
||
cy.get('.euiSuperSelectControl').contains('Slack').click({ force: true }); | ||
|
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 |
---|---|---|
|
@@ -28,7 +28,7 @@ describe('Test create email senders', () => { | |
.contains('Create SMTP sender') | ||
.click({ force: true }); | ||
cy.get('[data-test-subj="create-sender-form-name-input"]').type( | ||
'Test ssl sender' | ||
'test-ssl-sender' | ||
); | ||
cy.get('.euiButton__text').contains('Create').click({ force: true }); | ||
cy.contains('Some fields are invalid.').should('exist'); | ||
|
@@ -42,15 +42,15 @@ describe('Test create email senders', () => { | |
cy.get('[data-test-subj="create-sender-form-port-input"]').type('123'); | ||
cy.get('.euiButton__text').contains('Create').click({ force: true }); | ||
cy.contains('successfully created.').should('exist'); | ||
cy.contains('Test ssl sender').should('exist'); | ||
cy.contains('test-ssl-sender').should('exist'); | ||
}); | ||
|
||
it('creates tls sender', () => { | ||
cy.get('.euiButton__text') | ||
.contains('Create SMTP sender') | ||
.click({ force: true }); | ||
cy.get('[data-test-subj="create-sender-form-name-input"]').type( | ||
'Test tls sender' | ||
'test-tls-sender' | ||
); | ||
cy.get('[data-test-subj="create-sender-form-email-input"]').type( | ||
'[email protected]' | ||
|
@@ -68,15 +68,15 @@ describe('Test create email senders', () => { | |
|
||
cy.get('.euiButton__text').contains('Create').click({ force: true }); | ||
cy.contains('successfully created.').should('exist'); | ||
cy.contains('Test ssl sender').should('exist'); | ||
cy.contains('test-ssl-sender').should('exist'); | ||
}); | ||
|
||
it('creates SES sender', () => { | ||
cy.get('.euiButton__text') | ||
.contains('Create SES sender') | ||
.click({ force: true }); | ||
cy.get('[data-test-subj="create-ses-sender-form-name-input"]').type( | ||
'Test ses sender' | ||
'test-ses-sender' | ||
); | ||
cy.get('[data-test-subj="create-ses-sender-form-email-input"]').type( | ||
'[email protected]' | ||
|
@@ -90,7 +90,7 @@ describe('Test create email senders', () => { | |
|
||
cy.get('.euiButton__text').contains('Create').click({ force: true }); | ||
cy.contains('successfully created.').should('exist'); | ||
cy.contains('Test ses sender').should('exist'); | ||
cy.contains('test-ses-sender').should('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
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 |
---|---|---|
|
@@ -62,9 +62,9 @@ describe('creates sender and recipient groups as config object', () => { | |
is_enabled: true, | ||
email_group: { | ||
recipient_list: [ | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
{ recipient: '[email protected]' }, | ||
{ recipient: '[email protected]' }, | ||
{ recipient: '[email protected]' }, | ||
], | ||
}, | ||
}); | ||
|
@@ -73,7 +73,10 @@ describe('creates sender and recipient groups as config object', () => { | |
|
||
describe('handles combo box create option', () => { | ||
it('adds new option to combo box options', () => { | ||
const options = [{label: 'selected-option'}, { label: 'existing-option' }]; | ||
const options = [ | ||
{ label: 'selected-option' }, | ||
{ label: 'existing-option' }, | ||
]; | ||
const selectedOptions = [options[0]]; | ||
const setOptions = jest.fn(); | ||
const setSelectedOptions = jest.fn(); | ||
|
@@ -88,11 +91,17 @@ describe('handles combo box create option', () => { | |
setInputError | ||
); | ||
expect(setOptions).toBeCalledWith([...options, { label: 'new-option' }]); | ||
expect(setSelectedOptions).toBeCalledWith([...selectedOptions, { label: 'new-option' }]); | ||
expect(setSelectedOptions).toBeCalledWith([ | ||
...selectedOptions, | ||
{ label: 'new-option' }, | ||
]); | ||
}); | ||
|
||
it('selects existing option', () => { | ||
const options = [{label: 'selected-option'}, { label: 'existing-option' }]; | ||
const options = [ | ||
{ label: 'selected-option' }, | ||
{ label: 'existing-option' }, | ||
]; | ||
const selectedOptions = [options[0]]; | ||
const setOptions = jest.fn(); | ||
const setSelectedOptions = jest.fn(); | ||
|
@@ -107,6 +116,9 @@ describe('handles combo box create option', () => { | |
setInputError | ||
); | ||
expect(setOptions).not.toBeCalled(); | ||
expect(setSelectedOptions).toBeCalledWith([...selectedOptions, { label: 'existing-option' }]); | ||
expect(setSelectedOptions).toBeCalledWith([ | ||
...selectedOptions, | ||
{ label: 'existing-option' }, | ||
]); | ||
}); | ||
}); |
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
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 |
---|---|---|
|
@@ -186,12 +186,12 @@ const mockRecipientGroup: RecipientGroupItemType = { | |
last_updated_time_ms: 1622158742784, | ||
email_group: { | ||
recipient_list: [ | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
{ recipient: '[email protected]' }, | ||
{ recipient: '[email protected]' }, | ||
{ recipient: '[email protected]' }, | ||
{ recipient: '[email protected]' }, | ||
{ recipient: '[email protected]' }, | ||
{ recipient: '[email protected]' }, | ||
], | ||
}, | ||
}; | ||
|