Skip to content

Commit 68c23e9

Browse files
committed
Add test for empty host
1 parent 58114bb commit 68c23e9

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

cypress/e2e/features.cy.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,37 @@ describe('Meilisearch features', () => {
8888
cy.get('input[name="host"]').should('have.value', host)
8989
cy.get('input[name="apiKey"]').should('have.value', apiKey)
9090
})
91+
92+
it.only('displays error when setting empty host', () => {
93+
visitPluginPage()
94+
cy.get('button:contains("Settings")').click()
95+
96+
cy.get('input[name="host"]').clear()
97+
cy.contains('button', 'Save').click()
98+
99+
cy.removeNotifications()
100+
cy.get('input[name="host"]').should('have.value', '')
101+
102+
visitPluginPage()
103+
const row = `table[role='grid'] tbody tr:nth-child(1) button[role="checkbox"]`
104+
105+
cy.get(row).click()
106+
cy.contains('The provided host is not valid.').should('be.visible')
107+
cy.removeNotifications()
108+
109+
cy.get(row).should('not.be.checked')
110+
111+
visitPluginPage()
112+
cy.get('button:contains("Settings")').click()
113+
cy.get('input[name="host"]').should('have.value', '')
114+
cy.get('input[name="host"]').clear()
115+
cy.get('input[name="host"]').type(host)
116+
cy.contains('button', 'Save').click()
117+
cy.removeNotifications()
118+
})
91119
})
92120

93-
describe.only('Collections panel', () => {
121+
describe('Collections panel', () => {
94122
it('displays all collections', () => {
95123
visitPluginPage()
96124

0 commit comments

Comments
 (0)