Skip to content

Instantly share code, notes, and snippets.

View ibrahimBanat's full-sized avatar
:octocat:
Raising bugs

Ibrahim Banat ibrahimBanat

:octocat:
Raising bugs
View GitHub Profile
import React, {useEffect, useState} from 'react';
import Options from './Options';
import axios from 'axios';
import { useHistory } from 'react-router';
const Form = () => {
const history = useHistory();
const [isChecked, setIsChecked] = useState({
'none' : false,
'javascript': false,
<body class="font-sans antialiased text-gray-600 min-h-full flex flex-col min-h-full flex flex-col relative">
<main class="relative z-10 flex-auto flex items-center justify-center text-center text-gray-400 py-16 px-4 sm:px-6 lg:px-8">
<div>
<svg width="214" height="32" fill="none" class="mx-auto mb-12">
<path d="M25.043 2.286c-6.071 0-9.866 3.048-11.383 9.143 2.276-3.048 4.932-4.19 7.968-3.429 1.732.435 2.97 1.696 4.34 3.093C28.199 13.367 30.783 16 36.426 16c6.07 0 9.865-3.048 11.383-9.142-2.277 3.048-4.933 4.19-7.968 3.428-1.732-.434-2.97-1.696-4.34-3.092-2.232-2.275-4.816-4.908-10.458-4.908zM13.66 16c-6.07 0-9.866 3.048-11.383 9.143 2.276-3.048 4.932-4.19 7.968-3.428 1.731.434 2.97 1.696 4.34 3.092 2.231 2.275 4.815 4.908 10.458 4.908 6.07 0 9.865-3.048 11.383-9.143-2.277 3.048-4.933 4.19-7.969 3.428-1.73-.434-2.97-1.696-4.34-3.092C21.887 18.634 19.302 16 13.66 16z" fill="#06B6D4"></path>
<path d="M68.594 12.708V9.143h-4.235v-4.8L60.671 5.44v3.703H57.53v3.565h3.142v8.229c0 4.457 2.254
it("should return exception when passing empty array", () => {
//arrange
let arr = [];
//act
let sorted = insertionSort(arr);
//assert
expect(sorted).toEqual("Exception");
});
"use strict";
/**
* takes an array of intgers as input and returns
* and array of these intgers in sorted order from least ot the largest
* @param {Array} array of intgers
* @returns Array of sorted intgers
*/
function insertSort(array) {
if(array.length === 0) {
retrun 'Exception';
}
"use strict";
const insertionSort = require("../insertionSort");
describe("insertion sort testing", () => {
it("should sucessfully return sorted array", () => {
//arrange
let array = [8, 4, 23, 42, 16, 15];
//act
let sorted = insertionSort(array);
"use strict";
/**
* takes an array of intgers as input and returns
* and array of these intgers in sorted order from least ot the largest
* @param {Array} array of intgers
* @returns Array of sorted intgers
*/
function insertSort(array) {
function insertSort(array) {
for (let item = 1; item < array.length; item++) {
for (let index = item; index > 0; index--) {
if (array[index] < array[index - 1]) {
const temp = array[index];
array[index] = array[index - 1];
array[index - 1] = temp;
} else {
break;
}
function insertSort(array) {
for (let item = 1; item < array.length; item++) {
for (let index = item; index > 0; index--) {
if (array[index] < array[index - 1]) {
const temp = array[index];
array[index] = array[index - 1];
array[index - 1] = temp;
} else {
break;
}
function insertSort(array) {
for (let item = 1; item < array.length; item++) {
for (let index = item; index > 0; index--) {
if (array[index] < array[index - 1]) {
const temp = array[index];
array[index] = array[index - 1];
array[index - 1] = temp;
}
}
}