1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-07 20:40:05 +00:00

chore(sasjs-tests): remove unnecessary code, bump test framework version

This commit is contained in:
Krishna Acondy
2020-07-29 22:52:17 +01:00
parent 187917cb32
commit 5fad9d01bc
4 changed files with 164 additions and 145 deletions

View File

@@ -1,102 +0,0 @@
.app {
padding: 16px;
.controls {
display: flex;
align-items: center;
.debug-toggle,
.app-loc-input,
.submit-button {
margin: 16px 0;
}
.row {
margin: 16px;
&.app-loc {
width: 20vw;
}
}
.submit-button {
padding: 16px;
font-size: 1.25em;
}
.app-loc-input {
width: 100%;
}
}
.debug-toggle {
display: inline-flex;
justify-content: center;
align-items: center;
.label {
padding: 0 8px;
font-size: 1.25em;
}
}
$height: 40px;
$width: 70px;
.switch {
position: relative;
display: inline-flex;
width: $width;
height: $height;
input[type="checkbox"] {
display: none;
}
input:checked + .knob {
animation: colorChange 0.4s linear forwards;
}
input:checked + .knob:before {
animation: turnON 0.4s linear forwards;
}
}
@keyframes colorChange {
from {
background-color: #ccc;
}
50% {
background-color: #a4d9ad;
}
to {
background-color: #4bd663;
}
}
@keyframes turnON {
from {
transform: translateX(0px);
}
to {
transform: translateX($width - ($height * 0.99));
box-shadow: -10px 0px 44px 0px #434343;
}
}
.knob {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
border-radius: $height;
}
.knob:before {
position: absolute;
background-color: white;
content: "";
left: $height * 0.1;
top: $height * 0.1;
width: ($height * 0.8);
height: ($height * 0.8);
border-radius: 50%;
}
}

View File

@@ -5,17 +5,13 @@ import { sendArrTests, sendObjTests } from "./testSuites/RequestData";
import { specialCaseTests } from "./testSuites/SpecialCases";
import { sasjsRequestTests } from "./testSuites/SasjsRequests";
import "@sasjs/test-framework/dist/index.css";
import "./App.scss";
const App = (): ReactElement<{}> => {
const [appLoc, setAppLoc] = useState("");
const [debug, setDebug] = useState(false);
const { adapter, config } = useContext(AppContext);
const [testSuites, setTestSuites] = useState<TestSuite[]>([]);
useEffect(() => {
if (adapter) {
adapter.setDebugState(debug);
setTestSuites([
basicTests(adapter, config.userName, config.password),
sendArrTests(adapter),
@@ -24,44 +20,10 @@ const App = (): ReactElement<{}> => {
sasjsRequestTests(adapter),
]);
}
}, [debug, adapter, config]);
useEffect(() => {
if (appLoc && adapter) {
adapter.setSASjsConfig({ ...adapter.getSasjsConfig(), appLoc });
}
}, [appLoc, adapter]);
useEffect(() => {
setAppLoc(adapter.getSasjsConfig().appLoc);
}, [adapter]);
}, [adapter, config]);
return (
<div className="app">
<div className="controls">
<div className="row">
<label>Debug</label>
<div className="debug-toggle">
<label className="switch">
<input
type="checkbox"
onChange={(e) => setDebug(e.target.checked)}
/>
<span className="knob"></span>
</label>
</div>
</div>
<div className="row app-loc">
<label>App Loc</label>
<input
type="text"
className="app-loc-input"
value={appLoc}
onChange={(e) => setAppLoc(e.target.value)}
placeholder="AppLoc"
/>
</div>
</div>
{adapter && testSuites && <TestSuiteRunner testSuites={testSuites} />}
</div>
);