From df203c2e5e404797a7887663e4273c3916e778b6 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 26 Feb 2016 00:07:48 +0200 Subject: [PATCH 1/4] Check nothing is focused for search hotkey --- resources/views/header.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index 6074859a01..fe91073364 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -354,7 +354,7 @@ // Focus the search input if the user clicks forward slash $('body').keypress(function(event) { - if (event.which == 47) { + if (event.which == 47 && !$('*:focus').length) { event.preventDefault(); showSearch(); } From ce2e8c149a819af06189063fb94aa0ffb602a9bb Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 26 Feb 2016 11:47:39 +0200 Subject: [PATCH 2/4] Added test for vendors and expenses --- .travis.yml | 1 + tests/acceptance/ExpenseCest.php | 55 ++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 tests/acceptance/ExpenseCest.php diff --git a/.travis.yml b/.travis.yml index e3b0e7301e..015fda1427 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,6 +67,7 @@ script: - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php diff --git a/tests/acceptance/ExpenseCest.php b/tests/acceptance/ExpenseCest.php new file mode 100644 index 0000000000..a329f7a1d2 --- /dev/null +++ b/tests/acceptance/ExpenseCest.php @@ -0,0 +1,55 @@ +checkIfLogin($I); + + $this->faker = Factory::create(); + } + + public function createExpense(AcceptanceTester $I) + { + $I->wantTo('Create an expense'); + + $vendorName = $this->faker->name; + $clientEmail = $this->faker->safeEmail; + $amount = $this->faker->numberBetween(10, 20); + + // create vendor + $I->amOnPage('/vendors/create'); + $I->fillField(['name' => 'name'], $vendorName); + $I->click('Save'); + $I->see($vendorName); + $vendorId = $I->grabFromDatabase('vendors', 'id', ['name' => $vendorName]); + + // create client + $I->amOnPage('/clients/create'); + $I->fillField(['name' => 'contacts[0][email]'], $clientEmail); + $I->click('Save'); + $I->see($clientEmail); + + // create expense + $I->amOnPage('/expenses/create'); + $I->fillField(['name' => 'amount'], $amount); + $I->selectDropdown($I, $vendorName, '.vendor-select .dropdown-toggle'); + $I->selectDropdown($I, $clientEmail, '.client-select .dropdown-toggle'); + $I->click('Save'); + $I->seeInDatabase('expenses', ['vendor_id' => $vendorId]); + + // invoice expense + $I->executeJS('submitAction(\'invoice\')'); + $I->click('Save'); + $I->see($clientEmail); + $I->see($amount); + } +} From 44630308658d5d3838a6dd4260112776605cace9 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 26 Feb 2016 13:36:50 +0200 Subject: [PATCH 3/4] Added test for vendors and expenses --- .travis.yml | 22 +++++++++++----------- tests/acceptance/ExpenseCest.php | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 015fda1427..fa6fd12f35 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,18 +63,18 @@ before_script: - curl -L http://ninja.dev:8000/update script: - - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - - php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + #- php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php #- sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env #- php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php diff --git a/tests/acceptance/ExpenseCest.php b/tests/acceptance/ExpenseCest.php index a329f7a1d2..01cc3112d8 100644 --- a/tests/acceptance/ExpenseCest.php +++ b/tests/acceptance/ExpenseCest.php @@ -49,6 +49,7 @@ class ExpenseCest // invoice expense $I->executeJS('submitAction(\'invoice\')'); $I->click('Save'); + $I->wait(1); $I->see($clientEmail); $I->see($amount); } From ab2693ad52f6618b3e9b1dbdf4be5cfb3bb56aa0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 26 Feb 2016 14:36:48 +0200 Subject: [PATCH 4/4] Added test for vendors and expenses --- .travis.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index fa6fd12f35..015fda1427 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,18 +63,18 @@ before_script: - curl -L http://ninja.dev:8000/update script: - #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - #- php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php - #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + - php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php #- sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env #- php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php