Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change_status_fix #8224

Merged
merged 43 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6bc8802
change_status_fix
Noor-mommadhi Sep 13, 2023
cbd0787
Added_testcase
Noor-mommadhi Sep 20, 2023
03585f5
Apply fixes from StyleCI
StyleCIBot Sep 20, 2023
98b0fee
Merge pull request #8227 from ladybirdweb/analysis-djG9P9
bhanu2217 Sep 20, 2023
39838ec
Mobile menu button fix.
mucan54 Jun 18, 2023
36b6c12
search-bar-fix
Noor-mommadhi Sep 1, 2023
fed97d6
colors-changes
Noor-mommadhi Sep 4, 2023
8b838c2
changes
Noor-mommadhi Sep 13, 2023
cfd6b40
changes1
Noor-mommadhi Sep 15, 2023
7d07d8e
conversation content added for else statement
mucan54 Jul 24, 2023
34307d5
fix
KNaveenraj-ladybird Sep 12, 2023
f2cc975
fix
KNaveenraj-ladybird Sep 13, 2023
0bd6f0b
Added_testcase
Noor-mommadhi Sep 20, 2023
e1f6c29
Apply fixes from StyleCI
StyleCIBot Sep 20, 2023
9de0d66
Apply fixes from StyleCI
StyleCIBot Oct 9, 2023
7d59cfa
Merge pull request #8243 from ladybirdweb/analysis-O3KjEB
bhanu2217 Oct 9, 2023
970505a
Merge branch 'development' into change_status
KNaveenraj-ladybird Oct 9, 2023
837caf8
Merge branch 'development' into change_status
KNaveenraj-ladybird Oct 26, 2023
a9bb0cc
Apply fixes from StyleCI
StyleCIBot Oct 26, 2023
7408c05
Merge pull request #8265 from ladybirdweb/analysis-e01aQ4
bhanu2217 Oct 26, 2023
5cbec3f
test_config
KNaveenraj-ladybird Oct 25, 2023
329e817
Apply fixes from StyleCI
StyleCIBot Oct 25, 2023
0a9d9b3
commit-1
KNaveenraj-ladybird Oct 25, 2023
7cf17ff
commit-2
KNaveenraj-ladybird Oct 25, 2023
01ddbe2
commit-3
KNaveenraj-ladybird Oct 25, 2023
a184f0b
test_config
KNaveenraj-ladybird Oct 25, 2023
17f3d11
test_case_fixes
KNaveenraj-ladybird Oct 26, 2023
e198e87
Apply fixes from StyleCI
StyleCIBot Oct 26, 2023
9a95954
test_case_fixes2
KNaveenraj-ladybird Oct 26, 2023
d0a0a60
Apply fixes from StyleCI
StyleCIBot Oct 26, 2023
e35e735
Added_testcase
Noor-mommadhi Sep 20, 2023
2b69c8d
Apply fixes from StyleCI
StyleCIBot Sep 20, 2023
3c60008
Mobile menu button fix.
mucan54 Jun 18, 2023
1d01b66
colors-changes
Noor-mommadhi Sep 4, 2023
7f5cae0
changes
Noor-mommadhi Sep 13, 2023
5e0f322
changes1
Noor-mommadhi Sep 15, 2023
59bb2de
fix
KNaveenraj-ladybird Sep 12, 2023
c509841
Added_testcase
Noor-mommadhi Sep 20, 2023
c24911a
Apply fixes from StyleCI
StyleCIBot Sep 20, 2023
f8450a8
test_case_fix
KNaveenraj-ladybird Oct 26, 2023
dded9e5
Apply fixes from StyleCI
StyleCIBot Oct 26, 2023
b385900
Merge pull request #8268 from ladybirdweb/analysis-VBwEBD
bhanu2217 Oct 26, 2023
8bd1692
Merge branch 'development' into change_status
KNaveenraj-ladybird Oct 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 35 additions & 25 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="bootstrap/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">app/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="feature">
<directory>tests/Feature</directory>
</testsuite>
<testsuite name="unit">
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<!-- <env name="DB_CONNECTION" value="testing"/>
<env name="DB_DATABASE" value="testing_db"/> -->
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="MAIL_MAILER" value="mail"/>
<env name="APP_URL" value="http://localhost:8000"/>
<env name="DB_INSTALL" value="1"/>
</php>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="all">
<directory>./tests/</directory>
</testsuite>
<testsuite name="unit">
<directory>./tests/unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">app/</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="DB_CONNECTION" value="testing"/>
<env name="DB_DATABASE" value="testing_db"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="MAIL_MAILER" value="mail"/>
<env name="APP_URL" value="http://localhost:8000"/>
<env name="DB_DATABASE" value="testing_db"/>
<env name="DB_INSTALL" value="1"/>
</php>
</phpunit>

2 changes: 1 addition & 1 deletion public/lb-faveo/css/bootstrap5.min.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@extends('themes.default1.client.layout.client')
KNaveenraj-ladybird marked this conversation as resolved.
Show resolved Hide resolved
@section('breadcrumb')

<style>
.words {
margin-right: 10px; /* Adjust the value to increase or decrease the gap between list items */
Expand All @@ -21,6 +22,14 @@
//$user = App\User::where('id','=',$id1)->first();
?>
<!-- Main content -->


<div id="alert11" class="alert alert-dismissable alert-success" style="display: none;" role="aler">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<span id="message-success1" ></span>
</div>


<style type="text/css">
.caret {
border-left: 4px solid transparent;
Expand Down Expand Up @@ -623,19 +632,19 @@ function checkFunction() {
$("#refresh").load("../check_ticket/{!! $id !!} #refresh");
$("#refresh").show();
$("#loader").hide();
// $("#d1").trigger("click");
// var message = "Success! Your Ticket have been Closed";
// $("#alert11").show();
// $('#message-success1').html(message);
// setInterval(function(){
// $("#alert11").hide();
// setTimeout(function() {
// var link = document.querySelector('#load-inbox');
// if(link) {
// link.click();
// }
// }, 500);
// },2000);
$("#d1").trigger("click");
var message = "Success! Your Ticket have been Closed";
$("#alert11").show();
$('#message-success1').html(message);
setInterval(function(){
$("#alert11").hide();
setTimeout(function() {
var link = document.querySelector('#load-inbox');
if(link) {
link.click();
}
}, 500);
},2000);
}
})
return false;
Expand Down
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@
//===================================================================================
Route::middleware('auth')->group(function () {
Route::get('client-profile', [Client\helpdesk\GuestController::class, 'getProfile'])->name('client.profile'); /* User profile get */
Route::post('select/all', [Agent\helpdesk\TicketController::class, 'select_all'])->name('select_all');

Route::get('mytickets', [Client\helpdesk\GuestController::class, 'getMyticket'])->name('ticket2');
Route::get('myticket/{id}', [Client\helpdesk\GuestController::class, 'thread'])->name('ticket'); /* Get my tickets */
Expand Down
91 changes: 91 additions & 0 deletions tests/Unit/TicketControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php

namespace Tests\Unit;

use App\Model\helpdesk\Ticket\Ticket_Thread;
use App\Model\helpdesk\Ticket\Tickets;
use App\User;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Lang;
use Tests\TestCase;

class TicketControllerTest extends TestCase
{
use DatabaseTransactions;

/**
* A basic unit test example.
*
* @return void
*/
public function test_user_change_the_status()
{
$str = 'Demopass@1';
$password = Hash::make($str);
$user = new User([
'first_name' => 'a',
'last_name' => 'noor',
'email' => 'naveen12@gmail.com',
'user_name' => 'noor',
'password' => $password,
'active' => 1,
'role' => 'user',
]);
$user->save();

// Authenticate as the created user

$this->actingAs($user);

$ticket = new Tickets(
[
'ticket_number' => 'AAAA-0000-0001',
'user_id' => $user->id,
'priority_id' => 2,
'sla' => 2,
'help_topic_id' => 1,
'status' => 1,
'source' => 1,
]
);
$ticket->save();
$ticket->dept_id = 1;
$ticket->save();

$ticket_thread = new Ticket_Thread(
[
'ticket_id' => $ticket->id,
'user_id' => $user->id,
'poster' => 'client',
'title' => 'TestCase',
'body' => 'Testing',
]
);
$ticket_thread->save();

$mytickets = $this->get(route('ticket2'));
$mytickets->assertStatus(200);

$response = $this->post(route('select_all'), [
'select_all' => [$ticket->id],

'submit' => 'Open',

]);

// Assert that the response status code indicates success
$response->assertStatus(302); // Adjust this as needed

// Assert that the ticket's status has been updated to open

$response->assertSessionHas('success', Lang::get('lang.tickets_have_been_opened'));
$response = $this->post(route('select_all'), [
'select_all' => [$ticket->id],
'submit' => 'Close',
]);
$response->assertStatus(302); // Adjust this as needed
$this->assertEquals(3, $ticket->fresh()->status); // Adjust this as needed
$response->assertSessionHas('success', Lang::get('lang.tickets_have_been_closed'));
}
}