Skip to content

Commit

Permalink
Fix PR
Browse files Browse the repository at this point in the history
  • Loading branch information
nderkim committed Oct 21, 2022
1 parent 73d520c commit 27f53f0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
9 changes: 9 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from 'cypress';

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:8000/cypress-tests',
supportFile: false,
},
video: false,
});
4 changes: 0 additions & 4 deletions cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import selector from '../fixtures/selectors.json';
import cypressJson from '../../cypress.json';

const setup = [
{ width: 1440, height: 900, viewport: 'macbook-15', device: 'Laptop' },
Expand All @@ -9,12 +8,13 @@ const setup = [

describe('Multi Select', () => {
before(() => {
cy.visit(cypressJson.baseUrl);
cy.visit(Cypress.config('baseUrl')!);
cy.title().should('equal', 'React-Select');
cy.get('h1').should('contain', 'Test Page for Cypress');
});

beforeEach(() => {
cy.reload();
cy.reload(true);
});

for (let config of setup) {
Expand All @@ -34,7 +34,7 @@ describe('Multi Select', () => {
expect($defaultValue.eq(0)).to.contain('Red');
})
.get(selector.menuMulti)
.should('not.be.visible');
.should('not.exist');
});

it(`Should be able to remove values on keyboard actions in view: ${viewport}`, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import selector from '../fixtures/selectors.json';
import cypressJson from '../../cypress.json';

const setup = [
{
Expand All @@ -14,7 +13,7 @@ const setup = [

describe('Single Select', () => {
before(() => {
cy.visit(cypressJson.baseUrl);
cy.visit(Cypress.config('baseUrl')!);
cy.title().should('equal', 'React-Select');
cy.get('h1').should('contain', 'Test Page for Cypress');
});
Expand All @@ -28,7 +27,7 @@ describe('Single Select', () => {
});

beforeEach(() => {
cy.reload();
cy.reload(true);
});

// TODO:
Expand All @@ -46,6 +45,7 @@ describe('Single Select', () => {
.get(selector.menuSingle)
.should('not.be.visible');
});

it(`Should display a default value in view: ${viewport}`, () => {
cy.get(selector.singleBasicSelect)
.find(selector.singleValue)
Expand Down Expand Up @@ -138,7 +138,7 @@ describe('Single Select', () => {
.type('{backspace}', { force: true })
.get(selector.singleBasicSelect)
.find(selector.placeholder)
.should('not.be.visible');
.should('not.exist');
});
});

Expand All @@ -148,7 +148,7 @@ describe('Single Select', () => {
});

beforeEach(() => {
cy.reload();
cy.reload(true);
});

it(`Should display a default value in view: ${viewport}`, () => {
Expand Down Expand Up @@ -194,7 +194,7 @@ describe('Single Select', () => {
});

beforeEach(() => {
cy.reload();
cy.reload(true);
});

it(`Should display a default value in view: ${viewport}`, () => {
Expand Down Expand Up @@ -251,14 +251,14 @@ describe('Single Select', () => {
.type('{esc}', { force: true })
.get(selector.singleClearableSelect)
.find(selector.menu)
.should('not.be.visible')
.should('not.exist')
// Clear the value, verify menu doesn't pop
.get(selector.singleClearableSelect)
.find('input')
.type('{backspace}', { force: true })
.get(selector.singleClearableSelect)
.find(selector.menu)
.should('not.be.visible');
.should('not.exist');
});

it(`Should clear the value when escape is pressed if escapeClearsValue and menu is closed in view: ${viewport}`, () => {
Expand All @@ -271,14 +271,14 @@ describe('Single Select', () => {
.type('{esc}', { force: true })
.get(selector.singleBasicSelect)
.find(selector.menu)
.should('not.be.visible')
.should('not.exist')
// Escape again to verify value is not cleared
.get(selector.singleClearableSelect)
.find('input')
.type('{esc}', { force: true })
.get(selector.singleClearableSelect)
.find(selector.placeholder)
.should('not.be.visible')
.should('not.exist')
// Enable escapeClearsValue and try again, it should clear the value
.get(selector.singleClearable)
.find(selector.checkboxEscapeClearsValue)
Expand All @@ -290,7 +290,7 @@ describe('Single Select', () => {
.type('{esc}', { force: true })
.get(selector.singleBasicSelect)
.find(selector.menu)
.should('not.be.visible')
.should('not.exist')
// Escape again to clear value
.get(selector.singleClearableSelect)
.find('input')
Expand Down

0 comments on commit 27f53f0

Please sign in to comment.